mirror of https://github.com/grpc/grpc-java.git
netty: support `status()` on Headers
* netty: support `status()` on Headers
Recent Netty change a91df58ca1
caused the `status()` method to be invoked, which AbstractHttp2Headers does not implement.
This change is necesary to upgrade to Netty 4.1.14
This commit is contained in:
parent
04e0450304
commit
3efaccd81f
|
|
@ -124,6 +124,11 @@ class GrpcHttp2HeadersUtils {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence status() {
|
||||
return get(Http2Headers.PseudoHeaderName.STATUS.value());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CharSequence> getAll(CharSequence csName) {
|
||||
AsciiString name = requireAsciiString(csName);
|
||||
|
|
|
|||
|
|
@ -66,6 +66,16 @@ final class GrpcHttp2OutboundHeaders extends AbstractHttp2Headers {
|
|||
this.preHeaders = preHeaders;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("ReferenceEquality") // STATUS.value() never changes.
|
||||
public CharSequence status() {
|
||||
// preHeaders is never null. It has status as the first element or not at all.
|
||||
if (preHeaders.length >= 2 && preHeaders[0] == Http2Headers.PseudoHeaderName.STATUS.value()) {
|
||||
return preHeaders[1];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Entry<CharSequence, CharSequence>> iterator() {
|
||||
return new Itr();
|
||||
|
|
|
|||
Loading…
Reference in New Issue