Pawel,

On 9/26/20 19:07, Pawel Veselov wrote:
> Hello!
> 
> Tomcat 9.0.x
> 
> I'd like to force connection closure on some endpoints.
> I'm trying this on a simple JSP page.
> If I call response.setHeader("Connection","close"), I see that the
> response has "Connection: close, keep-alive".
> I assume Tomcat inserts the keep-alive part. It looks like the browsers
> still close the connection based on this, but I was wondering if it's
> possible to have Tomcat honor the header value set by the application.

Are you sure your application isn't issuing both headers? Or maybe a
proxy in between Tomcat and the browser?

> I was also wondering what does it mean - when multiple connection tokens
> are specified for a connection header. Breezing through the RFCs I can't
> find a clear statement on that except that multiple connection tokens are
> allowed in the header...

While it doesn't really make any sense to have the header value be
"close, keep-alive", it's a valid header value. The Connection header
requires at least one value, but can accept any number of them.

A reasonable client should expect that any "close" present means that
the connection should be closed after the response has completed.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to