Author: markt
Date: Fri Dec 14 17:26:08 2018
New Revision: 1848959
URL: http://svn.apache.org/viewvc?rev=1848959&view=rev
Log:
Include the optional content-length header in HTTP/2 responses where an
appropriate value is available.
Modified:
tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java?rev=1848959&r1=1848958&r2=1848959&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java Fri Dec 14
17:26:08 2018
@@ -156,6 +156,13 @@ class StreamProcessor extends AbstractPr
}
}
+ // Add a content-length header if a content length has been set unless
+ // the application has already added one
+ long contentLength = coyoteResponse.getContentLengthLong();
+ if (contentLength != -1 && headers.getValue("content-length") == null)
{
+ headers.addValue("content-length").setLong(contentLength);
+ }
+
// Add date header unless it is an informational response or the
// application has already set one
if (statusCode >= 200 && headers.getValue("date") == null) {
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1848959&r1=1848958&r2=1848959&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Dec 14 17:26:08 2018
@@ -63,6 +63,15 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Coyote">
+ <changelog>
+ <add>
+ <bug>63009</bug>: Include the optional <code>content-length</code>
+ header in HTTP/2 responses where an appropriate value is available.
+ (markt)
+ </add>
+ </changelog>
+ </subsection>
<subsection name="Tribes">
<changelog>
<update>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]