Merge pull request #298 from authorizerdev/fix/url-parsing
fix: remove extra slash from host
This commit is contained in:
commit
c948c98e94
|
@ -20,12 +20,12 @@ func GetHost(c *gin.Context) string {
|
||||||
authorizerURL = ""
|
authorizerURL = ""
|
||||||
}
|
}
|
||||||
if authorizerURL != "" {
|
if authorizerURL != "" {
|
||||||
return authorizerURL
|
return strings.TrimSuffix(authorizerURL, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
authorizerURL = c.Request.Header.Get("X-Authorizer-URL")
|
authorizerURL = c.Request.Header.Get("X-Authorizer-URL")
|
||||||
if authorizerURL != "" {
|
if authorizerURL != "" {
|
||||||
return authorizerURL
|
return strings.TrimSuffix(authorizerURL, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
scheme := c.Request.Header.Get("X-Forwarded-Proto")
|
scheme := c.Request.Header.Get("X-Forwarded-Proto")
|
||||||
|
@ -33,7 +33,7 @@ func GetHost(c *gin.Context) string {
|
||||||
scheme = "http"
|
scheme = "http"
|
||||||
}
|
}
|
||||||
host := c.Request.Host
|
host := c.Request.Host
|
||||||
return scheme + "://" + host
|
return strings.TrimSuffix(scheme+"://"+host, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetHostName function returns hostname and port
|
// GetHostName function returns hostname and port
|
||||||
|
|
Loading…
Reference in New Issue
Block a user