Skip to content

Commit

Permalink
feat: use the new RegisterDirectiveOrder to simplify config
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed May 31, 2024
1 parent 1451b41 commit 2f41cc3
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 9 deletions.
2 changes: 0 additions & 2 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
order vulcain before request_header

{$CADDY_GLOBAL_OPTIONS}
}

Expand Down
1 change: 1 addition & 0 deletions caddy/caddy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
func init() {
caddy.RegisterModule(Vulcain{})
httpcaddyfile.RegisterHandlerDirective("vulcain", parseCaddyfile)
httpcaddyfile.RegisterDirectiveOrder("vulcain", "before", "request_header")
}

var bufPool = sync.Pool{
Expand Down
2 changes: 0 additions & 2 deletions caddy/caddy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ func TestVulcain(t *testing.T) {
tester := caddytest.NewTester(t)
tester.InitServer(`
{
order vulcain before request_header
skip_install_trust
admin localhost:2999
http_port 9080
Expand Down
1 change: 0 additions & 1 deletion caddy/fixtures/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
debug
order vulcain before request_header
}

localhost:3000 {
Expand Down
4 changes: 0 additions & 4 deletions docs/gateway/caddy.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ Pre-built binaries are also available for download [on the releases page](https:
Example configuration:

```caddyfile
{
order vulcain before request_header
}
example.com {
vulcain {
openapi_file my-openapi-description.yaml # optional
Expand Down

0 comments on commit 2f41cc3

Please sign in to comment.