Skip to content

Commit ec1c2bd

Browse files
authored
Remove content type required setting (#61043)
This change removes the HTTP content type required setting, which was deprecated in 6.0 and only existed for users upgrading from 5.x so that they did not need to remove the setting immediately. The setting has no effect on behavior.
1 parent a0f4edf commit ec1c2bd

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

docs/reference/migration/migrate_8_0/http.asciidoc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@
88

99
// end::notable-breaking-changes[]
1010

11+
.The `http.content_type.required` setting has been removed.
12+
[%collapsible]
13+
====
14+
*Details* +
15+
The `http.content_type.required` setting was deprecated in Elasticsearch 6.0
16+
and has been removed in Elasticsearch 8.0. The setting was introduced in
17+
Elasticsearch 5.3 to prepare users for Elasticsearch 6.0, where content type
18+
auto detection was removed for HTTP requests.
19+
20+
*Impact* +
21+
Discontinue use of the `http.content_type.required` system property.
22+
Specifying this property in `elasticsearch.yml` will result in an error on
23+
startup.
24+
====
25+
1126
.The `http.tcp_no_delay` setting has been replaced by `http.tcp.no_delay`.
1227
[%collapsible]
1328
====
@@ -35,4 +50,4 @@ Update your workflow and applications to assume `+` in a URL is encoded as
3550
`%2B`. Discontinue use of the `es.rest.url_plus_as_space` system property.
3651
Specifying this property in `elasticsearch.yml` will result in an error on
3752
startup.
38-
====
53+
====

qa/full-cluster-restart/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) {
3535
numberOfNodes = 2
3636
// some tests rely on the translog not being flushed
3737
setting 'indices.memory.shard_inactive_time', '60m'
38-
setting 'http.content_type.required', 'true'
3938
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
4039
}
4140
}

qa/rolling-upgrade/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
4949

5050
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
5151
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
52-
setting 'http.content_type.required', 'true'
5352
}
5453
}
5554

qa/verify-version-constants/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) {
3232
testClusters {
3333
"${baseName}" {
3434
version = bwcVersion.toString()
35-
setting 'http.content_type.required', 'true'
3635
}
3736
}
3837

server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ public void apply(Settings value, Settings current, Settings previous) {
264264
HttpTransportSettings.SETTING_CORS_ALLOW_METHODS,
265265
HttpTransportSettings.SETTING_CORS_ALLOW_HEADERS,
266266
HttpTransportSettings.SETTING_HTTP_DETAILED_ERRORS_ENABLED,
267-
HttpTransportSettings.SETTING_HTTP_CONTENT_TYPE_REQUIRED,
268267
HttpTransportSettings.SETTING_HTTP_MAX_CONTENT_LENGTH,
269268
HttpTransportSettings.SETTING_HTTP_MAX_CHUNK_SIZE,
270269
HttpTransportSettings.SETTING_HTTP_MAX_HEADER_SIZE,

server/src/main/java/org/elasticsearch/http/HttpTransportSettings.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
package org.elasticsearch.http;
2121

22-
import org.elasticsearch.common.Booleans;
2322
import org.elasticsearch.common.network.NetworkService;
2423
import org.elasticsearch.common.settings.Setting;
2524
import org.elasticsearch.common.settings.Setting.Property;
@@ -72,15 +71,6 @@ public final class HttpTransportSettings {
7271
intSetting("http.publish_port", -1, -1, Property.NodeScope);
7372
public static final Setting<Boolean> SETTING_HTTP_DETAILED_ERRORS_ENABLED =
7473
Setting.boolSetting("http.detailed_errors.enabled", true, Property.NodeScope);
75-
public static final Setting<Boolean> SETTING_HTTP_CONTENT_TYPE_REQUIRED =
76-
new Setting<>("http.content_type.required", (s) -> Boolean.toString(true), (s) -> {
77-
final boolean value = Booleans.parseBoolean(s);
78-
if (value == false) {
79-
throw new IllegalArgumentException("http.content_type.required cannot be set to false. It exists only to make a rolling" +
80-
" upgrade easier");
81-
}
82-
return true;
83-
}, Property.NodeScope, Property.Deprecated);
8474
public static final Setting<ByteSizeValue> SETTING_HTTP_MAX_CONTENT_LENGTH =
8575
Setting.byteSizeSetting(
8676
"http.max_content_length",

x-pack/qa/rolling-upgrade/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
4242

4343
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
4444
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
45-
setting 'http.content_type.required', 'true'
4645
setting 'xpack.license.self_generated.type', 'trial'
4746
setting 'xpack.security.enabled', 'true'
4847
setting 'xpack.security.transport.ssl.enabled', 'true'

0 commit comments

Comments
 (0)