ajout CORS

This commit is contained in:
François Pelletier 2024-09-08 21:03:41 -04:00
parent f7abfc4902
commit d896049932
5 changed files with 68 additions and 20 deletions

View file

@ -1 +1,16 @@
# https://www.playframework.com/documentation/latest/Configuration
play.filters.hosts {
allowed = ["."]
}
play.filters.enabled += play.filters.headers.SecurityHeadersFilter
play.filters.headers {
contentSecurityPolicy = "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; frame-ancestors 'self' https://jevalide.ca"
}
play.filters.enabled += "play.filters.cors.CORSFilter"
play.filters.cors {
allowedOrigins = null // Allow all origins
allowedHttpMethods = ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
allowedHttpHeaders = ["Accept", "Content-Type"]
}