π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Warn for unconfigured same-host apps
Manav Rathi38dcbf37b278
diff --git a/server/cmd/museum/main.go b/server/cmd/museum/main.goindex feb7d3e828..ac4665b40b 100644--- a/server/cmd/museum/main.go+++ b/server/cmd/museum/main.go@@ -1429,10 +1429,6 @@ func corsForOrigins(origins []string) gin.HandlerFunc {if origin == "" || knownOrigins[normalizeOrigin(origin)] {return true}- parsed, err := url.Parse(origin)- if err == nil && strings.EqualFold(parsed.Host, c.Request.Host) {- return true- }// CollectionLinkMiddleware validates custom album domains.path := c.Request.URL.Pathreturn path == "/public-collection" || strings.HasPrefix(path, "/public-collection/")diff --git a/server/cmd/museum/main_cors_test.go b/server/cmd/museum/main_cors_test.goindex 9a53736bbe..c1741ab01d 100644--- a/server/cmd/museum/main_cors_test.go+++ b/server/cmd/museum/main_cors_test.go@@ -28,7 +28,7 @@ func TestCORS(t *testing.T) {{"unknown origin", http.MethodGet, "/users/details", "https://unknown.example", "api.ente.com", http.StatusNoContent, true, true},{"malformed origin", http.MethodGet, "/users/details", "%", "api.ente.com", http.StatusNoContent, true, true},{"native client", http.MethodGet, "/users/details", "", "api.ente.com", http.StatusNoContent, true, false},- {"same host", http.MethodPost, "/users/ott", "https://ente.example", "ente.example", http.StatusNoContent, true, false},+ {"unconfigured same host", http.MethodPost, "/users/ott", "https://ente.example", "ente.example", http.StatusNoContent, true, true},{"desktop app", http.MethodGet, "/users/details", "ente://app", "api.ente.com", http.StatusNoContent, true, false},{"custom album domain", http.MethodGet, "/public-collection/info", "https://gallery.example", "api.ente.com", http.StatusNoContent, true, false},{"album prefix lookalike", http.MethodGet, "/public-collection-evil", "https://gallery.example", "api.ente.com", http.StatusNoContent, true, true},