-
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
Graceful handling of invalid HTTP Methods #5881
Comments
What error logs do you see when Kong produces this response? |
In |
What jumps to my eyes (without attempting to reproduce locally) is that |
This is only because we modify This call actually is to the base path / which would normally throw a 404 not found standard proxy response message like:
So this is a dead end endpoint generally, I am just testing this to test because some user just decided to randomly try sending invalid HTTP Statuses to the gateway url with no proxy path on it and I saw this behavior and thought it was interesting and odd. |
I setup a local install of 1.4.3 and cannot recreate the behavior:
Kong logs:
It looks as if there is another proxy in between the client and Kong throwing the 500? |
Ooo, it may be a nginx module I am running too with Kong, let me disable that and will re-test if it somehow plays a role. And no it would not be a proxy between this is me testing from my localhost Kong node, will confirm shortly if its somehow the nginx module causing this. |
Thanks @jeremyjpj0916
|
Disabled the 3rd party module, the response to my curl client is still the same 500 error, taking a closer look at the logs I do see the first line similar to @aaronhmiller output.
I lack the Error might be how I am configuring my ENV variables or NGX template then... Hmm
I don't think any of these fields would do it though... maybe:
My Kong template looks like this, was playing with named error_page locations but will revert that too and test again to see if that is whats causing it:
|
AH HA IT IS USING NAMED error_page locations. I removed that tweak and saw what I would expect: /usr/local/kong $ curl -Xfoo localhost:8000/ -vv
I may still continue using them because this is an odd case and using named error_directives helps preserve METHOD and URI supposedly on proxy calls which helps with my 3rd party module. Closing this as its not actually a problem with default Kong but more so an NGINX issue when you start shaking things up. @thibaultcha I thought you might find this interesting though, even though with invalid headers it does produce this oddity but in all other cases it sounds like how to native maintain HTTP Method + URI on |
@jeremyjpj0916 We do not use named locations for |
Ah appreciate the link back, seems named locations has some other nuances(414 URI too long). NGINX is the gift that keeps on giving with other surprising nuances hah. |
Passing an invalid HTTP Method produces 500 level server errors.
Summary
Seems an odd behavior out of NGINX that affects Kong, I would expect a 400 Bad Request if anything on invalid HTTP Methods, otherwise to just allow it and pass through with no harm.
Steps To Reproduce
Additional Details & Logs
The text was updated successfully, but these errors were encountered: