Skip to content

Commit

Permalink
Merge pull request #434 from smaeda-ks/smaeda-ks/fix-rate-limit-module
Browse files Browse the repository at this point in the history
[Bug] honor original request method even if it's called from lookup
  • Loading branch information
vvuksan authored Feb 21, 2021
2 parents 7fc9ea8 + 1f5a17a commit a6c1e8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions etc/vcl_snippets_rate_limiting/miss.vcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if (req.http.Rate-Limit) {
set bereq.method = req.http.X-Orig-Method;
}
5 changes: 3 additions & 2 deletions etc/vcl_snippets_rate_limiting/recv.vcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if (####RATE_LIMITED_PATHS####) {
set req.http.Rate-Limit = "1";
set req.hash_ignore_busy = true;
set req.http.Rate-Limit = "1";
set req.http.X-Orig-Method = req.method;
set req.hash_ignore_busy = true;
}

0 comments on commit a6c1e8b

Please sign in to comment.