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
Case sensitive comparison of some headers causes issues in HTTP/2 environments #1226
Comments
PR submitted. If approved, then please please please consider backporting this to a 1.1.1 release as the current 1.1.0 version is unusable (if you want response payloads in anything but application/json that is) in HTTP/2 environments. |
Just to follow up. Would it be possible to push out a 1.1.1 release based on this fix sometime soon? |
Sure, I can do that. |
Actually, thinking just a little, there's an easier way to do a v1.1.1 - taking it from the v1.1.0 branch (which is pretty much what you propose ...). Sorry, my head is elsewhere the last couple of days. Still very busy but, yes, I'll try to do this on Thursday, once back from next week's trip (Kick-Off meeting for a new European project). |
Done - v1.1.1 is released |
When moving from Orion-LD 1.0.1 to 1.1.0 we experienced a regression where our solution worked perfectly in a docker composed environment, but failed mysteriously on Kubernetes using an istio service mesh. The problem has been tracked down to the fact that the Accept header is no longer respected, when invoking GET requests for /ngsi-ld/v1/entities or /ngsi-ld/v1/entities/{entityid}, in environments where headers are automatically lowercased (i.e. when using HTTP/2).
The behaviour can easily be reproduced by using curl and passing -H "accept: application/ld+json" to one of the above endpoints. The broker will then respond with Content-Type: application/json instead. A lower case -H "link: ...." will be respected though...
The new behaviour seems to have been introduced in #1001 where the accept header handling was rewritten. A lot of headers are properly compared using strcasecmp, but a few are compared using strcmp which causes the code to fail when Accept is being received as accept.
See for example
context.Orion-LD/src/lib/orionld/rest/orionldMhdConnectionInit.cpp
Line 416 in 80d6c41
The text was updated successfully, but these errors were encountered: