Author: markt
Date: Sat Mar 25 00:04:50 2017
New Revision: 1788572
URL: http://svn.apache.org/viewvc?rev=1788572&view=rev
Log:
:method, :scheme and :path are required headers
Found with the h2spec tool written by Moto Ishizawa.
Modified:
tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties
tomcat/trunk/java/org/apache/coyote/http2/Stream.java
Modified: tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties?rev=1788572&r1=1788571&r2=1788572&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties Sat Mar
25 00:04:50 2017
@@ -77,6 +77,7 @@ stream.header.case=Connection [{0}], Str
stream.header.debug=Connection [{0}], Stream [{1}], HTTP header [{2}], Value
[{3}]
stream.header.duplicate=Connection [{0}], Stream [{1}], received multiple
[{3}] headers
stream.header.noPath=Connection [{0}], Stream [{1}], The [:path] pseudo header
was empty
+stream.header.required=Connection [{0}], Stream [{1}], One or more required
headers was missing
stream.header.unexpectedPseudoHeader=Connection [{0}], Stream [{1}], Pseudo
header [{2}] received after a regular header
stream.header.unknownPseudoHeader=Connection [{0}], Stream [{1}], Unknown
pseudo header [{2}] received
stream.notWritable=Connection [{0}], Stream [{1}], This stream is not writable
Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Stream.java?rev=1788572&r1=1788571&r2=1788572&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/Stream.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Stream.java Sat Mar 25 00:04:50
2017
@@ -350,7 +350,12 @@ class Stream extends AbstractStream impl
}
- final boolean receivedEndOfHeaders() {
+ final boolean receivedEndOfHeaders() throws ConnectionException {
+ if (coyoteRequest.method().isNull() || coyoteRequest.scheme().isNull()
||
+ coyoteRequest.requestURI().isNull()) {
+ throw new
ConnectionException(sm.getString("stream.header.required",
+ getConnectionId(), getIdentifier()),
Http2Error.PROTOCOL_ERROR);
+ }
// Cookie headers need to be concatenated into a single header
// See RFC 7540 8.1.2.5
// Can only do this once the headers are fully received
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]