Skip to content

Commit

Permalink
remove static context from CorsProperties injection
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-baldwa committed Jan 24, 2025
1 parent c011913 commit 8d66ec0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class CorsGlobalConfiguration {

@Autowired
private static CorsProperties corsProperties;
private CorsProperties corsProperties;

@Bean
public WebFilter corsFilter() {
Expand All @@ -37,7 +37,7 @@ public WebFilter corsFilter() {
};
}

public static void fillCorsHeader(HttpHeaders responseHeaders) {
public void fillCorsHeader(HttpHeaders responseHeaders) {
responseHeaders.add("Access-Control-Allow-Origin", corsProperties.getAllowedOrigins());
responseHeaders.add("Access-Control-Allow-Credentials", corsProperties.getAllowCredentials());
responseHeaders.add("Access-Control-Allow-Methods", corsProperties.getAllowedMethods());
Expand Down

0 comments on commit 8d66ec0

Please sign in to comment.