Skip to content

Commit

Permalink
add a debug log for redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Mar 5, 2024
1 parent 4bfa831 commit 68854af
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ func (cr *Cluster) GetHandler() http.Handler {
u := *req.URL
u.Scheme = "https"
u.Host = net.JoinHostPort(host, strconv.Itoa((int)(cr.publicPort)))

logDebugf("Redirecting from %s to %s", req.Host, u.String())

rw.Header().Set("Location", u.String())
rw.Header().Set("Content-Length", "0")
rw.WriteHeader(http.StatusFound)
Expand Down

0 comments on commit 68854af

Please sign in to comment.