-
Notifications
You must be signed in to change notification settings - Fork 16
limit_req_zone with 4 arguments not being analyzed #104
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
Conversation
t.Run(name, func(t *testing.T) { | ||
t.Parallel() | ||
err := analyze("nginx.conf", tc.stmt, ";", tc.ctx, &ParseOptions{ | ||
DirectiveSources: []MatchFunc{NgxPlusLatestDirectivesMatchFn, AppProtectWAFv4DirectivesMatchFn}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test would pass without any other changes if we use a different source
DirectiveSources: []MatchFunc{NgxPlusLatestDirectivesMatchFn, AppProtectWAFv4DirectivesMatchFn}, | |
DirectiveSources: []MatchFunc{NgxPlusR31DirectivesMatchFn, AppProtectWAFv4DirectivesMatchFn}, |
NgxPlusLatestDirectivesMatchFn
thinks limit_req_zone
has a mask of ngxHTTPMainConf | ngxConfTake3 | ngxConfTake2,
, but NgxPlusR31DirectivesMatchFn
has the correct mask ngxHTTPMainConf | ngxConfTake3 | ngxConfTake4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding details from our conversation external to the PR. Take4
is only correct for NGINX+ to allow the sync
flag. OSS is Take3
.
The problem comes from a mismatch in a legacy version of code generator, the flag For the |
Happy to close this PR. Can we add tests to cover this scenario in #105 ? |
Yeah! Root reason comes from a legacy version of the generator has a wrong mapping from It would also be helpful to add an unit test for |
please do |
That would be great |
Proposed changes
Limit request zone has an issue with not being throwing: invalid number of arguments in "limit_req_zone" directive error despite being 4 arguments.
Checklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTING
documentREADME.md
)