You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Mark Thomas <ma...@apache.org> on 2020/06/24 15:10:05 UTC

Re: Tomcat 9 and response.setTrailerFields

On 24/06/2020 15:59, Julian Reschke wrote:
> 
> Hi,
> 
> I just tried to figure out whether Tomcat 9 will let be send trailer
> fields in a chunked HTTP/1.1 response, using
> 
> https://tomcat.apache.org/tomcat-9.0-doc/servletapi/javax/servlet/http/HttpServletResponse.html#setTrailerFields-java.util.function.Supplier-
> 
> 
> I couldn't get it to work yet, so below some questions:
> 
> 1) Is this actually supported for HTTP/1.1?

Yes.

> 2) Will it automatically switch to chunked encoding (leaving out
> content-length), or does the application code need to take care of that?

Tomcat will handle all of that but you need to make sure you set the
trailer fields before the response is committed so Tomcat can set the
appropriate headers.

> 3) I understand that I need to send "Trailer" upfront, but what about
> "TE" and "Connection"?

Just the Trailer header. Tomcat will look after the rest.

Mark


> 
> (pointer to working example would be cool as well)
> 
> Best regards, Julian
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Tomcat 9 and response.setTrailerFields

Posted by Mark Thomas <ma...@apache.org>.
Sorry. Auto completed to wrong list.

Mark


On 24/06/2020 16:10, Mark Thomas wrote:
> On 24/06/2020 15:59, Julian Reschke wrote:
>>
>> Hi,
>>
>> I just tried to figure out whether Tomcat 9 will let be send trailer
>> fields in a chunked HTTP/1.1 response, using
>>
>> https://tomcat.apache.org/tomcat-9.0-doc/servletapi/javax/servlet/http/HttpServletResponse.html#setTrailerFields-java.util.function.Supplier-
>>
>>
>> I couldn't get it to work yet, so below some questions:
>>
>> 1) Is this actually supported for HTTP/1.1?
> 
> Yes.
> 
>> 2) Will it automatically switch to chunked encoding (leaving out
>> content-length), or does the application code need to take care of that?
> 
> Tomcat will handle all of that but you need to make sure you set the
> trailer fields before the response is committed so Tomcat can set the
> appropriate headers.
> 
>> 3) I understand that I need to send "Trailer" upfront, but what about
>> "TE" and "Connection"?
> 
> Just the Trailer header. Tomcat will look after the rest.
> 
> Mark
> 
> 
>>
>> (pointer to working example would be cool as well)
>>
>> Best regards, Julian
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org