From ee2627931190249840e1bcd3c84df6c94add17a4 Mon Sep 17 00:00:00 2001 From: simsun Date: Mon, 18 Jul 2016 22:57:13 +0800 Subject: [PATCH] fix(context): retrieve scheme from X-Forwarded-Proto when it isn't none --- context/input.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/context/input.go b/context/input.go index edfdf530..c47996c9 100644 --- a/context/input.go +++ b/context/input.go @@ -89,6 +89,9 @@ func (input *BeegoInput) Site() string { // Scheme returns request scheme as "http" or "https". func (input *BeegoInput) Scheme() string { + if scheme := input.Header("X-Forwarded-Proto"); scheme != "" { + return scheme + } if input.Context.Request.URL.Scheme != "" { return input.Context.Request.URL.Scheme }