Commit b450b609 authored by Matija Obreza's avatar Matija Obreza

Allow CORS on /repository/d/**

parent 19edccfd
......@@ -93,6 +93,9 @@ public class WebConfiguration extends WebMvcConfigurerAdapter {
@Value("${base.url}")
private String baseUrl;
@Value("${frontend.url}")
private String frontendUrl;
@Scope("singleton")
@Bean
......@@ -184,12 +187,16 @@ public class WebConfiguration extends WebMvcConfigurerAdapter {
@Override
public void addCorsMappings(final CorsRegistry registry) {
registry.addMapping("/api/**")
// .allowedOrigins(uiOrigin)
// .allowedOrigins(frontendUrl)
.allowedMethods("PUT", "POST", "GET", "DELETE").maxAge(60*60*24);
// .allowedHeaders("header1", "header2", "header3")
// .exposedHeaders("header1", "header2")
// .allowCredentials(false).maxAge(3600);
registry.addMapping("/repository/d/**")
// .allowedOrigins(frontendUrl)
.allowedMethods("GET").maxAge(60*60*24);
registry.addMapping("/html/**").allowCredentials(false).allowedMethods("GET", "OPTIONS", "HEAD").allowedOrigins(baseUrl).maxAge(3600);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment