Author: markt Date: Fri Mar 24 23:55:35 2017 New Revision: 1788567 URL: http://svn.apache.org/viewvc?rev=1788567&view=rev Log: Header names must be lower case 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=1788567&r1=1788566&r2=1788567&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties Fri Mar 24 23:55:35 2017 @@ -73,6 +73,7 @@ http2Parser.swallow.debug=Connection [{0 pingManager.roundTripTime=Connection [{0}] Round trip time measured as [{1}]ns stream.closed=Connection [{0}], Stream [{1}], Unable to write to stream once it has been closed +stream.header.case=Connection [{0}], Stream [{1}], HTTP header name [{2}] must be in lower case 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.unexpectedPseudoHeader=Connection [{0}], Stream [{1}], Pseudo header [{2}] received after a regular header 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=1788567&r1=1788566&r2=1788567&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/Stream.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Stream.java Fri Mar 24 23:55:35 2017 @@ -22,6 +22,7 @@ import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.Iterator; +import java.util.Locale; import org.apache.coyote.ActionCode; import org.apache.coyote.CloseNowException; @@ -226,6 +227,12 @@ class Stream extends AbstractStream impl name, value)); } + // Header names must be lower case + if (!name.toLowerCase(Locale.US).equals(name)) { + throw new HpackException(sm.getString("stream.header.case", + getConnectionId(), getIdentifier(), name)); + } + if (headerStateErrorMsg != null) { // Don't bother processing the header since the stream is going to // be reset anyway --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org