diff --git a/caddyconfig/httpcaddyfile/directives.go b/caddyconfig/httpcaddyfile/directives.go index 417233336..6011b8591 100644 --- a/caddyconfig/httpcaddyfile/directives.go +++ b/caddyconfig/httpcaddyfile/directives.go @@ -178,6 +178,7 @@ func RegisterDirectiveOrder(dir string, position Positional, standardDir string) newOrder = append(newOrder[:i], append([]string{dir}, newOrder[i:]...)...) case After: newOrder = append(newOrder[:i+1], append([]string{dir}, newOrder[i+1:]...)...) + case First, Last: } break } diff --git a/modules/caddyevents/app.go b/modules/caddyevents/app.go index 398c10f1b..b7dc8f850 100644 --- a/modules/caddyevents/app.go +++ b/modules/caddyevents/app.go @@ -273,7 +273,6 @@ func (app *App) Emit(ctx caddy.Context, eventName string, data map[string]any) E // implement propagation up the module tree (i.e. start with "a.b.c" then "a.b" then "a" then "") for app.subscriptions[eventName] != nil { - for _, handler := range app.subscriptions[eventName][moduleID] { select { case <-ctx.Done(): diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go index 9dac84b81..07d692d5d 100644 --- a/modules/caddyhttp/matchers.go +++ b/modules/caddyhttp/matchers.go @@ -549,7 +549,6 @@ func (MatchPath) matchPatternWithEscapeSequence(escapedPath, matchPath string) b // iPattern and iPath are our cursors/iterator positions for each string var iPattern, iPath int for iPattern < len(matchPath) && iPath < len(escapedPath) { - // get the next character from the request path pathCh := string(escapedPath[iPath]) diff --git a/modules/caddyhttp/rewrite/rewrite.go b/modules/caddyhttp/rewrite/rewrite.go index e51aa3b55..2b18744db 100644 --- a/modules/caddyhttp/rewrite/rewrite.go +++ b/modules/caddyhttp/rewrite/rewrite.go @@ -378,7 +378,6 @@ func buildQueryString(qs string, repl *caddy.Replacer) string { func trimPathPrefix(escapedPath, prefix string) string { var iPath, iPrefix int for iPath < len(escapedPath) && iPrefix < len(prefix) { - prefixCh := prefix[iPrefix] ch := string(escapedPath[iPath])