-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix(key-auth): validate the configured headernames #2142
Conversation
fixes #2013 adds validation of header names (was completely absent) due to nginx/openresty config the '_' is also considered an invalid character.
Really don't like the actual implementation and dumping it in utils, but I guess it'll do the job. |
utils is the place for re-usable utility functions no? where else to put it? What specifically don't you like about the implementation? |
So far this code is not used anywhere but in the key-auth schema validation. Therefore, it has no reason for landing in utils by default. The implementation, aside from not adhering to the conventional code style discussed many times, uses Finally, I don't think the pattern is even relevant. Here is a quote from the Nginx documentation:
We're not writing PUC Lua. We're writing LuaJIT in Nginx. I think we should apply ngx_lua idioms and not PUC Lua ones. |
If it does not land in
Will update. But it is like this in many places where performance is non-critical. So update all matching to PCRE everywhere? through leave-behind-better-than-found policy?
hmmm, didn't look there, just implemented the rfc7230 with the additional But I agree to the more restrictive nginx implementation over tweaking the directive. |
* switched to nginx validation instead of rfc * using PCRE instead of build in matching * added whitespace
@thibaultcha updated style, PCRE and validation restrictions |
Manually merged with the correct commit grouping, naming and some style modifications. |
adds validation of header names (was completely absent)
due to nginx/openresty config the '_' is also considered an invalid
character.
Issues resolved
Fixes #2013