OpenSearch/qa/smoke-test-http/src/test/java/org/elasticsearch/http
Ioannis Kakavas 99aedc844d
Copy http headers to ThreadContext strictly (#45945) (#48675)
Previous behavior while copying HTTP headers to the ThreadContext,
would allow multiple HTTP headers with the same name, handling only
the first occurrence and disregarding the rest of the values. This
can be confusing when dealing with multiple Headers as it is not
obvious which value is read and which ones are silently dropped.

According to RFC-7230, a client must not send multiple header fields
with the same field name in a HTTP message, unless the entire field
value for this header is defined as a comma separated list or this
specific header is a well-known exception.

This commits changes the behavior in order to be more compliant to
the aforementioned RFC by requiring the classes that implement
ActionPlugin to declare if a header can be multi-valued or not when
registering this header to be copied over to the ThreadContext in
ActionPlugin#getRestHeaders.
If the header is allowed to be multivalued, then all such headers
are read from the HTTP request and their values get concatenated in
a comma-separated string.
If the header is not allowed to be multivalued, and the HTTP
request contains multiple such Headers with different values, the
request is rejected with a 400 status.
2019-10-31 23:05:12 +02:00
..
ContextAndHeaderTransportIT.java Copy http headers to ThreadContext strictly (#45945) (#48675) 2019-10-31 23:05:12 +02:00
CorsNotSetIT.java HLRest: Allow caller to set per request options (#30490) 2018-05-31 13:59:52 -04:00
CorsRegexIT.java HLRest: Allow caller to set per request options (#30490) 2018-05-31 13:59:52 -04:00
DeprecationHttpIT.java Switch many QA projects to use new style requests (#30574) 2018-05-15 17:48:47 -04:00
DetailedErrorsDisabledIT.java Docs: Fixed a grammatical mistake: 'a HTTP ...' -> 'an HTTP ...' (#33744) 2018-09-17 15:35:54 -04:00
DetailedErrorsEnabledIT.java Switch many QA projects to use new style requests (#30574) 2018-05-15 17:48:47 -04:00
HttpCompressionIT.java Deprecate types in index API (#36575) 2018-12-18 08:53:49 -05:00
HttpSmokeTestCase.java Remove `MockTcpTransport` for ESIntegTestCase (#36089) 2018-11-30 09:04:51 -07:00
NoHandlerIT.java HLRest: Allow caller to set per request options (#30490) 2018-05-31 13:59:52 -04:00
ResponseHeaderPluginIT.java HLRest: Allow caller to set per request options (#30490) 2018-05-31 13:59:52 -04:00
RestHttpResponseHeadersIT.java Switch many QA projects to use new style requests (#30574) 2018-05-15 17:48:47 -04:00
SearchRestCancellationIT.java Convert most awaitBusy calls to assertBusy (#45794) (#47112) 2019-09-29 12:21:46 +01:00
TestDeprecatedQueryBuilder.java Lowercase static final DeprecationLogger instance names (#34887) 2018-10-25 21:12:19 -07:00
TestDeprecationHeaderRestAction.java Remove use of Setting#getRaw in deprecation tests (#47262) 2019-09-30 06:35:59 -04:00
TestDeprecationPlugin.java Deguice rest handlers (#22575) 2017-01-20 11:48:51 -05:00
TestResponseHeaderPlugin.java Remove Settings from BaseRestRequest Constructor (#45418) (#45429) 2019-08-12 05:14:45 +02:00
TestResponseHeaderRestAction.java Remove Settings from BaseRestRequest Constructor (#45418) (#45429) 2019-08-12 05:14:45 +02:00