Apply gometalinter suggestions
This commit is contained in:
parent
9533aa45cc
commit
9bf553559c
8 changed files with 19 additions and 32 deletions
|
|
@ -37,7 +37,6 @@ var (
|
|||
annotationPassthrough = parser.GetAnnotationWithPrefix("ssl-passthrough")
|
||||
annotationAffinityType = parser.GetAnnotationWithPrefix("affinity")
|
||||
annotationCorsEnabled = parser.GetAnnotationWithPrefix("enable-cors")
|
||||
annotationCorsAllowOrigin = parser.GetAnnotationWithPrefix("cors-allow-origin")
|
||||
annotationCorsAllowMethods = parser.GetAnnotationWithPrefix("cors-allow-methods")
|
||||
annotationCorsAllowHeaders = parser.GetAnnotationWithPrefix("cors-allow-headers")
|
||||
annotationCorsAllowCredentials = parser.GetAnnotationWithPrefix("cors-allow-credentials")
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ var luaRestyWAFModes = map[string]bool{"ACTIVE": true, "INACTIVE": true, "SIMULA
|
|||
type Config struct {
|
||||
Mode string `json:"mode"`
|
||||
Debug bool `json:"debug"`
|
||||
IgnoredRuleSets []string `json: "ignored-rulesets"`
|
||||
ExtraRulesetString string `json: "extra-ruleset-string"`
|
||||
IgnoredRuleSets []string `json:"ignored-rulesets"`
|
||||
ExtraRulesetString string `json:"extra-ruleset-string"`
|
||||
}
|
||||
|
||||
// Equal tests for equality between two Config types
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue