Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RegisterDirectiveOrder for rate_limit before basic_auth #58

Closed
steffenbusch opened this issue Jul 8, 2024 · 1 comment · Fixed by #59
Closed

Use RegisterDirectiveOrder for rate_limit before basic_auth #58

steffenbusch opened this issue Jul 8, 2024 · 1 comment · Fixed by #59

Comments

@steffenbusch
Copy link
Contributor

I believe it would be a nice improvement if the Caddy HTTP Rate Limit Module leveraged the new RegisterDirectiveOrder feature from Caddy v2.8 (caddyserver/caddy#5865).

func init() {
	httpcaddyfile.RegisterHandlerDirective("rate_limit", parseCaddyfile)
+	httpcaddyfile.RegisterDirectiveOrder("rate_limit", "before", "basic_auth")
}

I would open a PR, but I am unsure if upgrading the go.mod requirements from github.com/caddyserver/caddy/v2 v2.7.6 to v2.8.4, along with all the other necessary updates after running go mod tidy, is acceptable for you and if it might break something for other users. I simply don't know enough about Go / Caddy module dependencies to assess this.

@francislavoie
Copy link

The minimum version required to use that is v2.8.0 so we can put that in the go.mod, though up to .4 is just bugfix releases, people shouldn't be building with an earlier patch at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants