Skip to content

Commit a2e7fae

Browse files
committed
update
1 parent cedfacb commit a2e7fae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

okhttp/src/main/java/io/grpc/okhttp/OkHttpServerTransport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ final class OkHttpServerTransport implements ServerTransport,
9393
private static final ByteString TE_TRAILERS = ByteString.encodeUtf8("trailers");
9494
private static final ByteString CONTENT_TYPE = ByteString.encodeUtf8("content-type");
9595
private static final ByteString CONTENT_LENGTH = ByteString.encodeUtf8("content-length");
96+
private static final ByteString ALLOW = ByteString.encodeUtf8("allow");
9697

9798
private final Config config;
9899
private final Variant variant = new Http2();
@@ -774,8 +775,7 @@ public void headers(boolean outFinished,
774775
}
775776

776777
if (!POST_METHOD.equals(httpMethod)) {
777-
List<Header> extraHeaders = Lists.newArrayList(new Header(ByteString.encodeUtf8("allow"),
778-
POST_METHOD));
778+
List<Header> extraHeaders = Lists.newArrayList(new Header(ALLOW, POST_METHOD));
779779
respondWithHttpError(streamId, inFinished, 405, Status.Code.INTERNAL,
780780
"HTTP Method is not supported: " + asciiString(httpMethod), extraHeaders);
781781
return;

0 commit comments

Comments
 (0)