Simplify origin checking
This commit is contained in:
parent
31d4c1d34f
commit
b3922864f2
|
@ -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
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user