Ajout CORS

This commit is contained in:
François Pelletier 2024-08-31 23:27:03 -04:00
parent b7635a1ac0
commit 0789487841
5 changed files with 65 additions and 15 deletions

View file

@ -1,3 +1,16 @@
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"]
}