mirror of
https://github.com/gogf/gf.git
synced 2025-04-05 11:18:50 +08:00
improve code
This commit is contained in:
parent
5537930210
commit
f6054ab37f
@ -224,8 +224,11 @@ func (r *Request) GetRemoteIp() string {
|
||||
|
||||
// GetUrl returns current URL of this request.
|
||||
func (r *Request) GetUrl() string {
|
||||
scheme := "http"
|
||||
proto := r.Header.Get("X-Forwarded-Proto")
|
||||
var (
|
||||
scheme = "http"
|
||||
proto = r.Header.Get("X-Forwarded-Proto")
|
||||
)
|
||||
|
||||
if r.TLS != nil || (proto != "" && strings.ToLower(proto) == "https") {
|
||||
scheme = "https"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user