Fix HttpHeaderValues.IDENTITY equals usage

Motivation:

HttpHeaderValues.IDENTITY is an AsciiString, but was compared using equals to a String.

Modifications:

Use contentEquals instead.

Result:
Correct comparison.
This commit is contained in:
Shixiong Zhu 2015-12-21 20:28:39 -08:00 committed by Norman Maurer
parent 72accceeac
commit b5d90388ea

View File

@ -101,7 +101,7 @@ public abstract class HttpContentDecoder extends MessageToMessageDecoder<HttpObj
// set new content encoding,
CharSequence targetContentEncoding = getTargetContentEncoding(contentEncoding);
if (HttpHeaderValues.IDENTITY.equals(targetContentEncoding)) {
if (HttpHeaderValues.IDENTITY.contentEquals(targetContentEncoding)) {
// Do NOT set the 'Content-Encoding' header if the target encoding is 'identity'
// as per: http://tools.ietf.org/html/rfc2616#section-14.11
headers.remove(HttpHeaderNames.CONTENT_ENCODING);