Skip to content

Commit

Permalink
Caddyfile support for log_key (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenbusch authored Jul 13, 2024
1 parent ae5d5ea commit 76d3984
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ rate_limit {
write_interval <duration>
purge_age <duration>
}
log_key <bool>
log_key
storage <module...>
jitter <percent>
sweep_interval <duration>
Expand Down Expand Up @@ -205,7 +205,8 @@ We also enable distributed rate limiting. By deploying this config to two or mor
"max_events": 2
}
},
"distributed": {}
"distributed": {},
"log_key": true
},
{
"handler": "static_response",
Expand Down Expand Up @@ -241,6 +242,7 @@ rate_limit {
events 2
window 5s
}
log_key
}
respond "I'm behind the rate limiter!"
Expand Down
6 changes: 6 additions & 0 deletions caddyfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
}
}

case "log_key":
if d.NextArg() {
return d.ArgErr()
}
h.LogKey = true

case "storage":
if !d.NextArg() {
return d.ArgErr()
Expand Down

0 comments on commit 76d3984

Please sign in to comment.