HttpObjectEncoder#isContentAlwaysEmpty cannot be overridden by subclasses
Motivation: Allow subclasses of HttpObjectEncoder other than HttpServerCodec to override the isContentAlwaysEmpty method Modification: Change the method visibility from package private to protected Result: Fixes #6761
This commit is contained in:
parent
1504abd474
commit
eee0ec3902
@ -195,7 +195,14 @@ public abstract class HttpObjectEncoder<H extends HttpMessage> extends MessageTo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isContentAlwaysEmpty(@SuppressWarnings("unused") H msg) {
|
/**
|
||||||
|
* Determine whether a message has a content or not. Some message may have headers indicating
|
||||||
|
* a content without having an actual content, e.g the response to an HEAD or CONNECT request.
|
||||||
|
*
|
||||||
|
* @param msg the message to test
|
||||||
|
* @return {@code true} to signal the message has no content
|
||||||
|
*/
|
||||||
|
protected boolean isContentAlwaysEmpty(@SuppressWarnings("unused") H msg) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public final class HttpServerCodec extends CombinedChannelDuplexHandler<HttpRequ
|
|||||||
private final class HttpServerResponseEncoder extends HttpResponseEncoder {
|
private final class HttpServerResponseEncoder extends HttpResponseEncoder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
boolean isContentAlwaysEmpty(@SuppressWarnings("unused") HttpResponse msg) {
|
protected boolean isContentAlwaysEmpty(@SuppressWarnings("unused") HttpResponse msg) {
|
||||||
return HttpMethod.HEAD.equals(queue.poll());
|
return HttpMethod.HEAD.equals(queue.poll());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user