linting fix

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

View file

@ -133,15 +133,17 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhtt
for _, m := range h.Mappings {
if m.re != nil {
matchRegexp := caddyhttp.MatchRegexp{Pattern: m.InputRegexp}
matchRegexp.Provision(caddy.Context{})
err := matchRegexp.Validate()
err := matchRegexp.Provision(caddy.Context{})
if err == nil {
if matchRegexp.Match(input, repl) {
if output := m.Outputs[destIdx]; output == nil {
continue
} else {
output = repl.ReplaceAll(m.Outputs[destIdx].(string), "")
return output, true
err = matchRegexp.Validate()
if err == nil {
if matchRegexp.Match(input, repl) {
if output := m.Outputs[destIdx]; output == nil {
continue
} else {
output = repl.ReplaceAll(m.Outputs[destIdx].(string), "")
return output, true
}
}
}
}