Created
October 11, 2018 14:26
-
-
Save nelsondspy/ca426f42e31a9c5ea836c4e353a0b513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
public CorsFilter corsFilter() { | |
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); | |
CorsConfiguration config = new CorsConfiguration(); | |
config.setAllowCredentials(true); | |
config.addAllowedOrigin("*"); | |
config.addAllowedHeader("*"); | |
config.addAllowedMethod("OPTIONS"); | |
config.addAllowedMethod("PATCH"); | |
config.addAllowedMethod("GET"); | |
config.addAllowedMethod("POST"); | |
config.addAllowedMethod("PUT"); | |
config.addAllowedMethod("DELETE"); | |
source.registerCorsConfiguration("/**", config); | |
return new CorsFilter(source); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment