Config: Allow CORS for fonts and CSS when using a CDN #3931

see https://www.w3.org/TR/css-fonts-3/#font-fetching-requirements

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-01-16 20:04:36 +01:00
parent c478025513
commit abfea6354c
13 changed files with 192 additions and 52 deletions

View File

@@ -64,11 +64,8 @@ func WebDAVAuth(conf *config.Config) gin.HandlerFunc {
return
}
// Block CDNs from caching this endpoint.
if header.IsCdn(c.Request) {
c.AbortWithStatus(http.StatusNotFound)
return
}
// Set vary response header.
c.Header(header.Vary, header.DefaultVary)
// Get basic authentication credentials, if any.
username, password, cacheKey, authorized := basicAuth(c)