Skip to content

Commit

Permalink
Make cors configuration more relaxed (#861)
Browse files Browse the repository at this point in the history
  • Loading branch information
Isti01 committed Feb 7, 2025
1 parent 1383f9b commit e54bd7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 4 additions & 7 deletions backend/src/main/kotlin/hu/bme/sch/cmsch/config/WebMvcConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@ class WebMvcConfig(
}

override fun addCorsMappings(registry: CorsRegistry) {
arrayOf("/api/**", "/manifest/**", "/cdn/**").forEach {
registry.addMapping(it)
.allowedOrigins(productionUrl)
.allowCredentials(true)
.allowedOriginPatterns(*allowedOrigins.toTypedArray())
.allowedMethods(*HttpMethod.values().map(HttpMethod::name).toTypedArray())
}
registry.addMapping("/**")
.allowCredentials(true)
.allowedOriginPatterns(*allowedOrigins.toTypedArray(), productionUrl)
.allowedMethods(*HttpMethod.values().map(HttpMethod::name).toTypedArray())
}
}
2 changes: 2 additions & 0 deletions backend/src/main/resources/config/application-env.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
logging.level.root=${ROOT_LOGGING_LEVEL:INFO}

hu.bme.sch.cmsch.startup.external=${EXTERNAL_FOLDER_PATH:/pv/cmsch/external/}
hu.bme.sch.cmsch.startup.audit-log=${AUDIT_LOG_PATH:/pv/cmsch/audit/}
hu.bme.sch.cmsch.startup.profile-generation-target=${PROFILE_GENERATION_PATH:/pv/cmsch/external/profiles}
Expand Down

0 comments on commit e54bd7d

Please sign in to comment.