Apply gometalinter suggestions

This commit is contained in:
Manuel de Brito Fontes 2018-04-25 18:53:49 -03:00
parent 9533aa45cc
commit 9bf553559c
8 changed files with 19 additions and 32 deletions

View file

@ -121,17 +121,17 @@ func (a authReq) Parse(ing *extensions.Ingress) (interface{}, error) {
return nil, ing_errors.NewLocationDenied("an empty string is not a valid URL")
}
authUrl, err := url.Parse(urlString)
authURL, err := url.Parse(urlString)
if err != nil {
return nil, err
}
if authUrl.Scheme == "" {
if authURL.Scheme == "" {
return nil, ing_errors.NewLocationDenied("url scheme is empty")
}
if authUrl.Host == "" {
if authURL.Host == "" {
return nil, ing_errors.NewLocationDenied("url host is empty")
}
if strings.Contains(authUrl.Host, "..") {
if strings.Contains(authURL.Host, "..") {
return nil, ing_errors.NewLocationDenied("invalid url host")
}
@ -162,7 +162,7 @@ func (a authReq) Parse(ing *extensions.Ingress) (interface{}, error) {
return &Config{
URL: urlString,
Host: authUrl.Hostname(),
Host: authURL.Hostname(),
SigninURL: signIn,
Method: authMethod,
ResponseHeaders: responseHeaders,