HADOOP-12767. Update apache httpclient version to 4.5.2; httpcore to 4.4.4. Artem Aliev via stevel.

This commit is contained in:
Steve Loughran 2016-05-19 14:44:44 +01:00
parent c7159f0240
commit 22ff9e68d1
4 changed files with 19 additions and 10 deletions

View File

@ -216,8 +216,11 @@ protected void setHandlerAuthMethod(SaslRpcServer.AuthMethod authMethod) {
@VisibleForTesting
static String getDoAs(HttpServletRequest request) {
List<NameValuePair> list = URLEncodedUtils.parse(request.getQueryString(),
UTF8_CHARSET);
String queryString = request.getQueryString();
if (queryString == null) {
return null;
}
List<NameValuePair> list = URLEncodedUtils.parse(queryString, UTF8_CHARSET);
if (list != null) {
for (NameValuePair nv : list) {
if (DelegationTokenAuthenticatedURL.DO_AS.

View File

@ -45,8 +45,11 @@ class ServletUtils {
*/
public static String getParameter(HttpServletRequest request, String name)
throws IOException {
List<NameValuePair> list = URLEncodedUtils.parse(request.getQueryString(),
UTF8_CHARSET);
String queryString = request.getQueryString();
if (queryString == null) {
return null;
}
List<NameValuePair> list = URLEncodedUtils.parse(queryString, UTF8_CHARSET);
if (list != null) {
for (NameValuePair nv : list) {
if (name.equals(nv.getName())) {

View File

@ -462,12 +462,12 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.5</version>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.2.5</version>
<version>4.4.4</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>

View File

@ -423,11 +423,14 @@ private void methodAction(final HttpServletRequest req,
// Append the user-provided path and query parameter to the original
// tracking url.
List<NameValuePair> queryPairs =
URLEncodedUtils.parse(req.getQueryString(), null);
UriBuilder builder = UriBuilder.fromUri(trackingUri);
for (NameValuePair pair : queryPairs) {
builder.queryParam(pair.getName(), pair.getValue());
String queryString = req.getQueryString();
if (queryString != null) {
List<NameValuePair> queryPairs =
URLEncodedUtils.parse(queryString, null);
for (NameValuePair pair : queryPairs) {
builder.queryParam(pair.getName(), pair.getValue());
}
}
URI toFetch = builder.path(rest).build();