You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2015/11/11 20:32:31 UTC
svn commit: r1713919 -
/tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java
Author: markt
Date: Wed Nov 11 19:32:31 2015
New Revision: 1713919
URL: http://svn.apache.org/viewvc?rev=1713919&view=rev
Log:
Handle date and content type headers in unit tests that use the simple request
Modified:
tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java
Modified: tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java?rev=1713919&r1=1713918&r2=1713919&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java Wed Nov 11 19:32:31 2015
@@ -52,6 +52,11 @@ import org.apache.tomcat.util.http.MimeH
*/
public abstract class Http2TestBase extends TomcatBaseTest {
+ // Nothing special about this date apart from it being the date I ran the
+ // test that demonstrated that most HTTP/2 tests were failing because the
+ // response now included a date header
+ private static final String DEFAULT_DATE = "Wed, 11 Nov 2015 19:18:42 GMT";
+
static final String DEFAULT_CONNECTION_HEADER_VALUE = "Upgrade, HTTP2-Settings";
private static final byte[] EMPTY_SETTINGS_FRAME =
{ 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 };
@@ -350,6 +355,12 @@ public abstract class Http2TestBase exte
result.append(streamId);
result.append("-Header-[:status]-[200]\n");
result.append(streamId);
+ result.append("-Header-[content-type]-[application/octet-stream]\n");
+ result.append(streamId);
+ result.append("-Header-[date]-[");
+ result.append(DEFAULT_DATE);
+ result.append("]\n");
+ result.append(streamId);
result.append("-HeadersEnd\n");
result.append(streamId);
result.append("-Body-");
@@ -764,6 +775,10 @@ public abstract class Http2TestBase exte
@Override
public void emitHeader(String name, String value, boolean neverIndex) {
+ // Date headers will always change so use a hard-coded default
+ if ("date".equals(name)) {
+ value = DEFAULT_DATE;
+ }
trace.append(lastStreamId + "-Header-[" + name + "]-[" + value + "]\n");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org