Skip to content

Commit

Permalink
Fix redirect loop with no prefix on debug endpoints
Browse files Browse the repository at this point in the history
Fixes #680
  • Loading branch information
jacksontj committed Sep 14, 2024
1 parent 20ab35d commit 25786e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/promxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ func main() {
r.NotFound = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Have our fallback rules
if strings.HasPrefix(r.URL.Path, path.Join(webOptions.RoutePrefix, "/debug")) {
http.StripPrefix(webOptions.RoutePrefix, http.DefaultServeMux).ServeHTTP(w, r)
http.StripPrefix(strings.Trim(webOptions.RoutePrefix, "/"), http.DefaultServeMux).ServeHTTP(w, r)
} else if r.URL.Path == path.Join(webOptions.RoutePrefix, "/-/ready") {
if stopping {
w.WriteHeader(http.StatusServiceUnavailable)
Expand Down

0 comments on commit 25786e6

Please sign in to comment.