-
Notifications
You must be signed in to change notification settings - Fork 24
Description
When testing a WMS service, we've encountered many failed tests that were caused by checking case-sensitive HTTP response headers. According to HTTP/1 specification, all HTTP headers are case-insensitive. According to HTTP/2, they should all be in lowercase.
We are using HAProxy as our reverse proxy, which follows this specifications and converts all HTTP headers to lowercase.
Example: our view service, located here, fails at test at51-getmap-request-parameter
at assertion Fail if service does not return OWS Exception Report
. This assertion checks the content of HTTP response header Content-Type
(note the word capitalization). Since our response headers are lowercase (i.e. content-type
), the test fails. We believe this is not correct behaviour. Link to Test report from official INSPIRE validator is here.
Solution (for testing view services):
- Most response headers are read with method
messageExchange.getResponseHeaders().get(...)
- these should probably be changed tomessageExchange.getResponseHeaders().getCaseInsensitive(...)
(docs). - I've also found calls to
testRequest.response.responseHeaders.get(...)
. Converting these calls totestRequest.response.responseHeaders.getCaseInsensitive(...)
should also do the trick, since it seems that theresponseHeaders
is also an instance of objectStringToStringsMap
(just like above).
We have ran into this issue when testing view services, but the same issue might also exist in other tests.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status