Skip to content

Commit

Permalink
Return after redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeguy committed Oct 14, 2023
1 parent 4ed8c6f commit 0c4ed88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions service/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ func handleRequest(w http.ResponseWriter, r *http.Request) {
hostNonWww := getHostNonWww(r.Host)
if hostNonWww != "" {
redirectToHost(w, r, hostNonWww)
return
}

if site.Domain != r.Host && site.NeedRedirect {
redirectToHost(w, r, site.Domain)
return
}

if site.Node == "" {
Expand All @@ -124,6 +126,7 @@ func handleRequest(w http.ResponseWriter, r *http.Request) {
// This domain only supports https but receive http request, redirect to https
if r.TLS == nil {
redirectToHttps(w, r)
return
}
}

Expand Down

0 comments on commit 0c4ed88

Please sign in to comment.