Simplify origin checking

This commit is contained in:
Dane Everitt 2020-12-25 14:40:28 -08:00
parent 31d4c1d34f
commit b3922864f2
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -84,19 +84,11 @@ func GetHandler(s *server.Server, w http.ResponseWriter, r *http.Request) (*Hand
if o == config.Get().PanelLocation { if o == config.Get().PanelLocation {
return true return true
} }
for _, origin := range config.Get().AllowedOrigins { for _, origin := range config.Get().AllowedOrigins {
if origin == "*" { if origin == "*" || origin == o {
return true return true
} }
if o != origin {
continue
}
return true
} }
return false return false
}, },
} }