Allow CORS on the public server
This commit is contained in:
parent
65cc41e376
commit
905d1239a0
|
@ -141,7 +141,7 @@ public class ServletExamples {
|
||||||
|
|
||||||
config.addExposedHeader("Location");
|
config.addExposedHeader("Location");
|
||||||
config.addExposedHeader("Content-Location");
|
config.addExposedHeader("Content-Location");
|
||||||
config.setAllowedMethods(Arrays.asList("GET","POST","PUT","DELETE","OPTIONS"));
|
config.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"));
|
||||||
|
|
||||||
// Create the interceptor and register it
|
// Create the interceptor and register it
|
||||||
CorsInterceptor interceptor = new CorsInterceptor(config);
|
CorsInterceptor interceptor = new CorsInterceptor(config);
|
||||||
|
|
|
@ -190,7 +190,7 @@ public class TestRestfulServer extends RestfulServer {
|
||||||
config.addAllowedOrigin("*");
|
config.addAllowedOrigin("*");
|
||||||
config.addExposedHeader("Location");
|
config.addExposedHeader("Location");
|
||||||
config.addExposedHeader("Content-Location");
|
config.addExposedHeader("Content-Location");
|
||||||
config.setAllowedMethods(Arrays.asList("GET","POST","PUT","DELETE","OPTIONS"));
|
config.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"));
|
||||||
registerInterceptor(corsInterceptor);
|
registerInterceptor(corsInterceptor);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue