Skip to content

Commit

Permalink
cors configs for remove items #EA-3958
Browse files Browse the repository at this point in the history
  • Loading branch information
gsergiu committed Nov 28, 2024
1 parent fe89af9 commit 1930389
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,20 @@ public void addCorsMappings(CorsRegistry registry) {
.allowCredentials(false).maxAge(600L); // in seconds


// insert/remove multiple items
registry.addMapping("/set/*/items").allowedOrigins("*").allowedMethods("PUT", "DELETE")

Check warning

Code scanning / SonarCloud

The program defines an overly permissive Cross-Origin Resource Sharing (CORS) policy See more on SonarQube Cloud Warning

The program defines an overly permissive Cross-Origin Resource Sharing (CORS) policy See more on SonarQube Cloud
.exposedHeaders(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN,
HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, HttpHeaders.ALLOW, HttpHeaders.ETAG,
HttpHeaders.VARY, HttpHeaders.PREFERENCE_APPLIED)
.allowCredentials(false).maxAge(600L); // in seconds

// publish/unpublish
registry.addMapping("/set/*/*").allowedOrigins("*").allowedMethods("PUT")
.exposedHeaders(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN,
HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, HttpHeaders.ALLOW, HttpHeaders.ETAG,
HttpHeaders.VARY, HttpHeaders.PREFERENCE_APPLIED)
.allowCredentials(false).maxAge(600L); // in seconds

// add,remove,exists item in set
registry.addMapping("/set/*/*/*").allowedOrigins("*")
.allowedMethods("GET", "HEAD", "PUT", "DELETE")
Expand Down

0 comments on commit 1930389

Please sign in to comment.