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:
Trustin Lee 2015-11-29 13:44:52 +09:00 committed by Norman Maurer
parent 9dd68d0c3e
commit c1f3200c87
2 changed files with 3 additions and 3 deletions

View File

@ -261,7 +261,7 @@ public class HttpClientUpgradeHandler extends HttpObjectAggregator implements Ch
builder.append(part);
builder.append(',');
}
builder.append(HttpHeaderNames.UPGRADE);
builder.append(HttpHeaderValues.UPGRADE);
request.headers().set(HttpHeaderNames.CONNECTION, builder.toString());
}
}

View File

@ -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"}
*/