Ole*_*Ole 1 java rest spring spring-mvc spring-boot
我正在阅读这个Spring安全教程,它提到我们可能会看到2个动态资源请求,因为这个控制器有一个CORS协商:
@SpringBootApplication
@RestController
public class UiApplication {
@RequestMapping("/resource")
public Map<String,Object> home() {
Map<String,Object> model = new HashMap<String,Object>();
model.put("id", UUID.randomUUID().toString());
model.put("content", "Hello World");
return model;
}
public static void main(String[] args) {
SpringApplication.run(UiApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
只是好奇这个@RestController注释是否默认启用CORS?
| 归档时间: |
|
| 查看次数: |
2315 次 |
| 最近记录: |