-
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
Catching invalid target urls #149
Comments
I think it should be clear that it's either |
Further API test cases, all
The idea of having one protocol per API seems limiting to me. Services rely on the |
protocol switching should certainly be allowed, I was referring to just the "adding an API" scenario, there's no third option other than however as you suggested a protocol change may occur at anytime ... which brought up a few scenarios / approaches to mind:
regardless, Kong should respond with appropriate error codes, and in this case should not even attempt to process an invalid protocol |
Not only can API protocols change, APIs can support multiple protocols. Maybe I should have created a new issue instead of adding that last paragraph since it seems to have sidetracked the main issue, but since we're here now I'll reply to your bullet points. Your first bullet point is what I brought up at the end when I asked about switching Regarding your second bullet point, there should be a plugin to optionally add SSL/TLS but that is outside of the scope of this issue, so I would create a separate issue for that. Here's where this issue stands:
|
If we do one then the other is useless? What do we do here? Which protocols do we support? |
Well hopefully the validation will catch any new invalid URLs from being added, but if I upgrade Kong it should return a 502 instead of a 500 for the invalid ones I already have in the system. Also what if I added the API directly to Cassandra? Today Kong supports HTTP 1.1 and HTTP over TLS/SSL (HTTPS) but there will be demand for SPDY and HTTP/2. My idea was to allow a single API to support multiple protocols but I didn't put much thought into it and it was more of an attempt to get a discussion and brainstorming session rolling. Anyway it should be in it's own issue as it's not really related to this one. |
Just to add more data to the initial issue, nginx returns
This is going to be hard to catch at runtime, an easier to catch when creating the API. When creating the API in order to make sure the
|
I think we should check the protocol at the API insertion time, but it's going to be tricky for us to implement a proper Checking the protocol would be the first step, and make sure it's either |
It now checks that the URL is valid, and the protocol is |
I put in a wrong target url (htttp://mockbin.com/, extra t in the protocol) and was getting 500 errors from Kong. I believe the standard response code to return for this case would be a 502 or 504. Kong could also catch this type of error during API creation, although I'm not sure if that's actually a good idea.
The text was updated successfully, but these errors were encountered: