Skip to content

Commit

Permalink
feat: set cors to open by default, needs to be changed
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed May 30, 2024
1 parent fd82c4c commit f274ef6
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.camptocamp.opendata.ogc.features.autoconfigure.geotools.PostgisBackendAutoConfiguration;
Expand Down Expand Up @@ -42,7 +43,7 @@
* <ul>
* <li>{@link CollectionRepository}
* </ul>
*
*
* @see PostgisBackendAutoConfiguration
* @see SampleDataBackendAutoConfiguration
*/
Expand Down Expand Up @@ -77,7 +78,7 @@ DataApiDelegate dataApiDelegate(CollectionRepository repo) {

/**
* {@inheritDoc}
*
*
* @see CsvFeatureCollectionHttpMessageConverter
* @see ShapefileFeatureCollectionHttpMessageConverter
* @see Excel2007FeatureCollectionHttpMessageConverter
Expand Down Expand Up @@ -180,4 +181,9 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
chain.doFilter(request, response);
}
}

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("*");
}
}

0 comments on commit f274ef6

Please sign in to comment.