mirror of
https://github.com/astaxie/beego.git
synced 2024-11-05 02:50:56 +00:00
Merge pull request #2050 from simpleton/bug/original_scheme
fix(context): retrieve scheme from X-Forwarded-Proto when it isn't none
This commit is contained in:
commit
d11823548b
@ -89,6 +89,9 @@ func (input *BeegoInput) Site() string {
|
|||||||
|
|
||||||
// Scheme returns request scheme as "http" or "https".
|
// Scheme returns request scheme as "http" or "https".
|
||||||
func (input *BeegoInput) Scheme() string {
|
func (input *BeegoInput) Scheme() string {
|
||||||
|
if scheme := input.Header("X-Forwarded-Proto"); scheme != "" {
|
||||||
|
return scheme
|
||||||
|
}
|
||||||
if input.Context.Request.URL.Scheme != "" {
|
if input.Context.Request.URL.Scheme != "" {
|
||||||
return input.Context.Request.URL.Scheme
|
return input.Context.Request.URL.Scheme
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user