mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-28 11:17:09 +02:00
fix: redirectHTTP middleware redirect loop when behind another proxy
This commit is contained in:
@@ -19,7 +19,7 @@ var RedirectHTTP = NewMiddleware[redirectHTTP]()
|
|||||||
|
|
||||||
// before implements RequestModifier.
|
// before implements RequestModifier.
|
||||||
func (m *redirectHTTP) before(w http.ResponseWriter, r *http.Request) (proceed bool) {
|
func (m *redirectHTTP) before(w http.ResponseWriter, r *http.Request) (proceed bool) {
|
||||||
if r.TLS != nil {
|
if r.TLS != nil || r.Header.Get("X-Forwarded-Proto") == "https" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user