Update Server.go

Fixed default site bypassing access filter bug
This commit is contained in:
Toby Chui 2024-04-30 13:25:26 +08:00
parent 7ba997dfc2
commit a9695e969e

View File

@ -102,6 +102,13 @@ func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
/* /*
Root Router Handling Root Router Handling
*/ */
//Root access control based on default rule
blocked := h.handleAccessRouting("default", w, r)
if blocked {
return
}
//Clean up the request URI //Clean up the request URI
proxyingPath := strings.TrimSpace(r.RequestURI) proxyingPath := strings.TrimSpace(r.RequestURI)
if !strings.HasSuffix(proxyingPath, "/") { if !strings.HasSuffix(proxyingPath, "/") {