mirror of https://github.com/grpc/grpc-java.git
netty: Check for TE header after checking Content-Type
Checking too early leads to false-positives, like if a non-gRPC client contacts the server or a grpc-web client.
This commit is contained in:
parent
5912d62019
commit
bd48891dab
|
|
@ -370,13 +370,6 @@ class NettyServerHandler extends AbstractNettyHandler {
|
|||
|
||||
private void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers)
|
||||
throws Http2Exception {
|
||||
if (!teWarningLogged && !TE_TRAILERS.contentEquals(headers.get(TE_HEADER))) {
|
||||
logger.warning(String.format("Expected header TE: %s, but %s is received. This means "
|
||||
+ "some intermediate proxy may not support trailers",
|
||||
TE_TRAILERS, headers.get(TE_HEADER)));
|
||||
teWarningLogged = true;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
// Remove the leading slash of the path and get the fully qualified method name
|
||||
|
|
@ -416,6 +409,13 @@ class NettyServerHandler extends AbstractNettyHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!teWarningLogged && !TE_TRAILERS.contentEquals(headers.get(TE_HEADER))) {
|
||||
logger.warning(String.format("Expected header TE: %s, but %s is received. This means "
|
||||
+ "some intermediate proxy may not support trailers",
|
||||
TE_TRAILERS, headers.get(TE_HEADER)));
|
||||
teWarningLogged = true;
|
||||
}
|
||||
|
||||
// The Http2Stream object was put by AbstractHttp2ConnectionHandler before calling this
|
||||
// method.
|
||||
Http2Stream http2Stream = requireHttp2Stream(streamId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue