summaryrefslogtreecommitdiff
path: root/docs/reference
diff options
context:
space:
mode:
Diffstat (limited to 'docs/reference')
-rw-r--r--docs/reference/api-conventions.asciidoc24
-rw-r--r--docs/reference/migration/migrate_6_0/rest.asciidoc6
-rw-r--r--docs/reference/modules/http.asciidoc3
3 files changed, 31 insertions, 2 deletions
diff --git a/docs/reference/api-conventions.asciidoc b/docs/reference/api-conventions.asciidoc
index 712a7969a0..7e8ed1c1c8 100644
--- a/docs/reference/api-conventions.asciidoc
+++ b/docs/reference/api-conventions.asciidoc
@@ -670,7 +670,27 @@ The response looks like:
For libraries that don't accept a request body for non-POST requests,
you can pass the request body as the `source` query string parameter
-instead.
+instead. When using this method, the `source_content_type` parameter
+should also be passed with a media type value that indicates the format
+of the source, such as `application/json`.
+
+[float]
+=== Content-Type auto-detection
+
+deprecated[5.3.0, Provide the proper Content-Type header]
+
+The content sent in a request body or using the `source` query string
+parameter is inspected to automatically determine the content type
+(JSON, YAML, SMILE, or CBOR).
+
+A strict mode can be enabled which disables auto-detection and requires
+that all requests with a body have a Content-Type header that maps to
+a supported format. To enabled this strict mode, add the following
+setting to the `elasticsearch.yml` file:
+
+ http.content_type.required: true
+
+The default value is `false`.
[[url-access-control]]
== URL-based access control
@@ -682,7 +702,7 @@ the choice of specifying an index in the URL and on each individual request
within the request body. This can make URL-based access control challenging.
To prevent the user from overriding the index which has been specified in the
-URL, add this setting to the `config.yml` file:
+URL, add this setting to the `elasticsearch.yml` file:
rest.action.multi.allow_explicit_index: false
diff --git a/docs/reference/migration/migrate_6_0/rest.asciidoc b/docs/reference/migration/migrate_6_0/rest.asciidoc
index 1999ff6517..f7b52b914d 100644
--- a/docs/reference/migration/migrate_6_0/rest.asciidoc
+++ b/docs/reference/migration/migrate_6_0/rest.asciidoc
@@ -13,6 +13,12 @@ has been removed in Elasticsearch 6.0.0.
In previous versions of Elasticsearch, documents were allowed to contain duplicate keys. Elasticsearch 6.0.0
enforces that all keys are unique. This applies to all content types: JSON, CBOR, Yaml and Smile.
+==== Content-Type Auto-detection
+
+In previous versions of Elasticsearch, having a proper Content-Type for the data in a request was not enforced.
+Elasticsearch 6.0.0 enforces that all requests with a body must have a supported Content-Type and this type will
+be used when parsing the data.
+
==== Boolean API parameters
All REST APIs parameters (both request parameters and JSON body) support providing boolean "false" as the
diff --git a/docs/reference/modules/http.asciidoc b/docs/reference/modules/http.asciidoc
index 065c91349c..3682234f5e 100644
--- a/docs/reference/modules/http.asciidoc
+++ b/docs/reference/modules/http.asciidoc
@@ -100,6 +100,9 @@ simple message will be returned. Defaults to `true`
|`http.pipelining.max_events` |The maximum number of events to be queued up in memory before a HTTP connection is closed, defaults to `10000`.
+|`http.content_type.required`|Enables or disables strict checking and usage of
+the `Content-Type` header for all requests with content, defaults to `false`.
+
|=======================================================================
It also uses the common