OpenSearch/client
Jay Modi 7520a107be Optionally require a valid content type for all rest requests with content (#22691)
This change adds a strict mode for xcontent parsing on the rest layer. The strict mode will be off by default for 5.x and in a separate commit will be enabled by default for 6.0. The strict mode, which can be enabled by setting `http.content_type.required: true` in 5.x, will require that all incoming rest requests have a valid and supported content type header before the request is dispatched. In the non-strict mode, the Content-Type header will be inspected and if it is not present or not valid, we will continue with auto detection of content like we have done previously.

The content type header is parsed to the matching XContentType value with the only exception being for plain text requests. This value is then passed on with the content bytes so that we can reduce the number of places where we need to auto-detect the content type.

As part of this, many transport requests and builders were updated to provide methods that
accepted the XContentType along with the bytes and the methods that would rely on auto-detection have been deprecated.

In the non-strict mode, deprecation warnings are issued whenever a request with body doesn't provide the Content-Type header.

See #19388
2017-02-02 14:07:13 -05:00
..
benchmark Optionally require a valid content type for all rest requests with content (#22691) 2017-02-02 14:07:13 -05:00
client-benchmark-noop-api-plugin Optionally require a valid content type for all rest requests with content (#22691) 2017-02-02 14:07:13 -05:00
rest Support Preemptive Authentication with RestClient (#21336) 2017-01-24 11:34:05 -05:00
rest-high-level Make RestHighLevelClient non final 2017-01-05 11:29:41 +01:00
sniffer Update Jackson to 2.8.6 (#22596) 2017-01-13 09:05:48 +01:00
test move ignore parameter support from yaml test client to low level rest client (#22637) 2017-01-16 18:54:44 +01:00
transport Upgrade to Netty 4.1.7 2017-01-12 10:58:21 -05:00