-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce Content-Type requirement on the rest layer and remove depreca…
…ted methods (#23146) This commit enforces the requirement of Content-Type for the REST layer and removes the deprecated methods in transport requests and their usages. While doing this, it turns out that there are many places where *Entity classes are used from the apache http client libraries and many of these usages did not specify the content type. The methods that do not specify a content type explicitly have been added to forbidden apis to prevent more of these from entering our code base. Relates #19388
- Loading branch information
Showing
108 changed files
with
371 additions
and
1,154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Licensed to Elasticsearch under one or more contributor | ||
# license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright | ||
# ownership. Elasticsearch licenses this file to you under | ||
# the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on | ||
# an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
# either express or implied. See the License for the specific | ||
# language governing permissions and limitations under the License. | ||
|
||
@defaultMessage Explicitly specify the ContentType of HTTP entities when creating | ||
org.apache.http.entity.StringEntity#<init>(java.lang.String) | ||
org.apache.http.entity.StringEntity#<init>(java.lang.String,java.lang.String) | ||
org.apache.http.entity.StringEntity#<init>(java.lang.String,java.nio.charset.Charset) | ||
org.apache.http.entity.ByteArrayEntity#<init>(byte[]) | ||
org.apache.http.entity.ByteArrayEntity#<init>(byte[],int,int) | ||
org.apache.http.entity.FileEntity#<init>(java.io.File) | ||
org.apache.http.entity.InputStreamEntity#<init>(java.io.InputStream) | ||
org.apache.http.entity.InputStreamEntity#<init>(java.io.InputStream,long) | ||
org.apache.http.nio.entity.NByteArrayEntity#<init>(byte[]) | ||
org.apache.http.nio.entity.NByteArrayEntity#<init>(byte[],int,int) | ||
org.apache.http.nio.entity.NFileEntity#<init>(java.io.File) | ||
org.apache.http.nio.entity.NStringEntity#<init>(java.lang.String) | ||
org.apache.http.nio.entity.NStringEntity#<init>(java.lang.String,java.lang.String) | ||
|
||
@defaultMessage Use non-deprecated constructors | ||
org.apache.http.nio.entity.NFileEntity#<init>(java.io.File,java.lang.String) | ||
org.apache.http.nio.entity.NFileEntity#<init>(java.io.File,java.lang.String,boolean) | ||
org.apache.http.entity.FileEntity#<init>(java.io.File,java.lang.String) | ||
org.apache.http.entity.StringEntity#<init>(java.lang.String,java.lang.String,java.lang.String) | ||
|
||
@defaultMessage BasicEntity is easy to mess up and forget to set content type | ||
org.apache.http.entity.BasicHttpEntity#<init>() | ||
|
||
@defaultMessage EntityTemplate is easy to mess up and forget to set content type | ||
org.apache.http.entity.EntityTemplate#<init>(org.apache.http.entity.ContentProducer) | ||
|
||
@defaultMessage SerializableEntity uses java serialization and makes it easy to forget to set content type | ||
org.apache.http.entity.SerializableEntity#<init>(java.io.Serializable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.