Skip to content

Commit

Permalink
web: prefix redirect with ExternalURL path
Browse files Browse the repository at this point in the history
  • Loading branch information
brancz committed May 22, 2017
1 parent 45df5c2 commit ad22606
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"sort"
"strings"
Expand Down Expand Up @@ -170,7 +171,7 @@ func New(o *Options) *Handler {
instrf := prometheus.InstrumentHandlerFunc

router.Get("/", func(w http.ResponseWriter, r *http.Request) {
router.Redirect(w, r, "/graph", http.StatusFound)
router.Redirect(w, r, path.Join(o.ExternalURL.Path, "/graph"), http.StatusFound)
})

router.Get("/alerts", instrf("alerts", h.alerts))
Expand Down

0 comments on commit ad22606

Please sign in to comment.