Fix the incorrect usage/value of 'Connection: upgrade'
Motivation: HttpClientUpgradeHandler uses HttpHeaderNames.UPGRADE as the value of the 'Connection' header, which is incorrect. It should use HttpHeaderValues.UPGRADE instead (note Names vs Values.) Also, HttpHeaderValues.UPGRADE should be 'upgrade' rather than 'Upgrade', as defined in: - https://tools.ietf.org/html/rfc7230#section-6.7 Modifications: - Use HttpHeaderValues.UPGRADE for a 'Connection' header - Lowercase the value of HttpHeaderValues.UPGRADE Result: - Fixes #4508 - Correct behavior
This commit is contained in:
parent
0d7caac883
commit
d68219c4e4
|
@ -223,7 +223,7 @@ public class HttpClientUpgradeHandler extends HttpObjectAggregator {
|
|||
builder.append(part);
|
||||
builder.append(',');
|
||||
}
|
||||
builder.append(HttpHeaderNames.UPGRADE);
|
||||
builder.append(HttpHeaderValues.UPGRADE);
|
||||
request.headers().set(HttpHeaderNames.CONNECTION, builder.toString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,9 +193,9 @@ public final class HttpHeaderValues {
|
|||
*/
|
||||
public static final AsciiString TRAILERS = new AsciiString("trailers");
|
||||
/**
|
||||
* {@code "Upgrade"}
|
||||
* {@code "upgrade"}
|
||||
*/
|
||||
public static final AsciiString UPGRADE = new AsciiString("Upgrade");
|
||||
public static final AsciiString UPGRADE = new AsciiString("upgrade");
|
||||
/**
|
||||
* {@code "websocket"}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue