Skip to content

Commit b473fd7

Browse files
authored
Merge pull request #6 from WMS-DEV/backend-add-list
Pls CORS stop being annoying
2 parents 1bb9a61 + ad71af7 commit b473fd7

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

backend/hacknation/src/main/java/pl/wmsdev/hacknation/http/CORSFilter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
3030
} else {
3131
filterChain.doFilter(request, response);
3232
}
33-
log.info("Added CORS headers to response using CORSFilter");
34-
33+
// log.info("Added CORS headers to response using CORSFilter");
3534
}
3635

3736
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package pl.wmsdev.hacknation.http;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.Configuration;
5+
import org.springframework.web.servlet.config.annotation.CorsRegistry;
6+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
7+
8+
@Configuration
9+
public class CorsConfig {
10+
@Bean
11+
public WebMvcConfigurer corsConfigurer() {
12+
return new WebMvcConfigurer() {
13+
@Override
14+
public void addCorsMappings(CorsRegistry registry) {
15+
registry.addMapping("/**")
16+
.allowedOrigins("*")
17+
.allowedMethods("*")
18+
.allowedHeaders("*");
19+
}
20+
};
21+
}
22+
}

0 commit comments

Comments
 (0)