linting fix

This commit is contained in:
Rajat Jain 2021-01-29 01:35:19 +05:30
parent 3a76cc7b0b
commit cafd7296f4

View file

@ -133,8 +133,9 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhtt
for _, m := range h.Mappings { for _, m := range h.Mappings {
if m.re != nil { if m.re != nil {
matchRegexp := caddyhttp.MatchRegexp{Pattern: m.InputRegexp} matchRegexp := caddyhttp.MatchRegexp{Pattern: m.InputRegexp}
matchRegexp.Provision(caddy.Context{}) err := matchRegexp.Provision(caddy.Context{})
err := matchRegexp.Validate() if err == nil {
err = matchRegexp.Validate()
if err == nil { if err == nil {
if matchRegexp.Match(input, repl) { if matchRegexp.Match(input, repl) {
if output := m.Outputs[destIdx]; output == nil { if output := m.Outputs[destIdx]; output == nil {
@ -146,6 +147,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhtt
} }
} }
} }
}
if input == m.Input { if input == m.Input {
if output := m.Outputs[destIdx]; output == nil { if output := m.Outputs[destIdx]; output == nil {
continue continue