Skip to content

Commit 892ca57

Browse files
committed
adding patch necessary to set HTTPS headers when needed
1 parent 17f412e commit 892ca57

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

oauthproxy.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,16 @@ func (p *OAuthProxy) Authenticate(rw http.ResponseWriter, req *http.Request) int
610610
} else {
611611
rw.Header().Set("GAP-Auth", session.Email)
612612
}
613+
614+
// XXX (guitmz): Adds HTTPS verification and header (if applicable) that is necessary for our Ghost blog using SSL
615+
switch {
616+
case p.redirectURL.Scheme != "":
617+
req.Header.Set("X-Forwarded-Proto", p.redirectURL.Scheme)
618+
case p.CookieSecure:
619+
req.Header.Set("X-Forwarded-Proto", "https")
620+
default:
621+
req.Header.Set("X-Forwarded-Proto", "http")
622+
}
613623
return http.StatusAccepted
614624
}
615625

0 commit comments

Comments
 (0)