Skip to content

Commit 21e4ac1

Browse files
committed
Upgrade to Netty 4.1
Issue: SPR-14143
1 parent 4407bd7 commit 21e4ac1

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ configure(allprojects) { project ->
6363
ext.jsonpathVersion = "2.2.0"
6464
ext.jtaVersion = "1.2"
6565
ext.junitVersion = "4.12"
66-
ext.nettyVersion = "4.0.36.Final"
67-
ext.okhttp3Version = "3.2.0"
66+
ext.nettyVersion = "4.1.0.CR7"
6867
ext.okhttpVersion = "2.7.5"
68+
ext.okhttp3Version = "3.2.0"
6969
ext.openjpaVersion = "2.4.1"
7070
ext.poiVersion = "3.14"
7171
ext.protobufVersion = "2.6.1"

spring-web/src/main/java/org/springframework/http/client/Netty4ClientHttpRequest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,8 +42,8 @@
4242
import org.springframework.util.concurrent.SettableListenableFuture;
4343

4444
/**
45-
* {@link org.springframework.http.client.ClientHttpRequest} implementation that uses
46-
* Netty 4 to execute requests.
45+
* {@link org.springframework.http.client.ClientHttpRequest} implementation
46+
* that uses Netty 4 to execute requests.
4747
*
4848
* <p>Created via the {@link Netty4ClientHttpRequestFactory}.
4949
*
@@ -148,8 +148,8 @@ private FullHttpRequest createFullHttpRequest(HttpHeaders headers) {
148148
FullHttpRequest nettyRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1,
149149
nettyMethod, this.uri.toString(), this.body.buffer());
150150

151-
nettyRequest.headers().set(HttpHeaders.HOST, uri.getHost());
152-
nettyRequest.headers().set(HttpHeaders.CONNECTION, io.netty.handler.codec.http.HttpHeaders.Values.CLOSE);
151+
nettyRequest.headers().set(HttpHeaders.HOST, this.uri.getHost());
152+
nettyRequest.headers().set(HttpHeaders.CONNECTION, "close");
153153

154154
for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
155155
nettyRequest.headers().add(entry.getKey(), entry.getValue());

spring-web/src/main/java/org/springframework/http/client/Netty4ClientHttpResponse.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,8 +28,8 @@
2828
import org.springframework.util.Assert;
2929

3030
/**
31-
* {@link org.springframework.http.client.ClientHttpResponse} implementation that uses
32-
* Netty 4 to execute requests.
31+
* {@link org.springframework.http.client.ClientHttpResponse} implementation
32+
* that uses Netty 4 to parse responses.
3333
*
3434
* @author Arjen Poutsma
3535
* @since 4.1.2
@@ -56,11 +56,13 @@ public Netty4ClientHttpResponse(ChannelHandlerContext context, FullHttpResponse
5656

5757

5858
@Override
59+
@SuppressWarnings("deprecation")
5960
public int getRawStatusCode() throws IOException {
6061
return this.nettyResponse.getStatus().code();
6162
}
6263

6364
@Override
65+
@SuppressWarnings("deprecation")
6466
public String getStatusText() throws IOException {
6567
return this.nettyResponse.getStatus().reasonPhrase();
6668
}

0 commit comments

Comments
 (0)