Skip to content

Commit

Permalink
servenv: more url parsing fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Vicent Marti <[email protected]>
  • Loading branch information
vmg committed Feb 8, 2024
1 parent de671eb commit 9578c28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions go/vt/servenv/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package servenv
import (
"expvar"
"net/http"
"net/url"
"sync"
"time"

Expand Down Expand Up @@ -150,9 +151,10 @@ func (e *Exporter) URLPrefix() string {
// There are two other places where this logic is duplicated:
// status.go and go/vt/vtgate/discovery/healthcheck.go.
if e.name == "" {
return e.name
return ""
}
return "/" + e.name
prefix, _ := url.JoinPath("/", e.name)
return prefix
}

// HandleFunc sets or overwrites the handler for url. If Exporter has a name,
Expand Down

0 comments on commit 9578c28

Please sign in to comment.