I found an example on how to set cors headers in spring-boot application. Since we have many origins, I need to add them. Is the following valid?
@Configuration
In Spring boot there is an annotation @CrossOrigin which will simply add header in the response.
1. For multiple:
@CrossOrigin(origins = {"http://localhost:7777", "http://someserver:8080"})
@RequestMapping(value = "/abc", method = RequestMethod.GET)
@ResponseBody
public Object doSomething(){
...
}
2. If you wanna allow for everyone then simply use.
@CrossOrigin