fix proxy normalize empty path to /

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2026-03-30 21:56:12 +02:00
parent fd078b453c
commit 32bc29269e
+6 -1
View File
@@ -1641,7 +1641,12 @@ func (m *ProxyHandler) matchesPath(capture service.ProxyServiceCaptureRule, req
if capture.PathRe == nil {
return true
}
return capture.PathRe.MatchString(req.URL.Path)
// normalize empty path to "/" so rules like path: / match root requests
path := req.URL.Path
if path == "" {
path = "/"
}
return capture.PathRe.MatchString(path)
}
func (m *ProxyHandler) handlePathBasedCapture(capture service.ProxyServiceCaptureRule, session *service.ProxySession, resp *http.Response) {