Konstantin,
On 6/18/25 6:08 PM, Konstantin Kolinko wrote:
<snip/>
A quick review of all Filters that are running tells me that there are a
few that can set response headers, but mostly are not in this particular
case. The list of headers coming back in the response are:
HTTP/1.1 200
Via: HTTP/1.1 1
Transfer-Encoding: chunked
Date: Wed, 18 Jun 2025 15:12:58 GMT
Notably, I'm not getting a response output stream or writer anywhere
before the "Hello World" is printed, and the header sizes are so small
that they should also not be triggering a response flush before then.
Before writing the Hello World, I checked to see if the response has
been committed using HttpServletResponse.isCommitted() and the return
value is /false/ O_O.
I checked *after* the write and the response still says it is not committed.
I was even able to call response.reset() after the write and then
re-write the response to "Goodbye, World". No exceptions, etc.
Is there something else I should be checking?
The 'Via' header suggests that the response might be a proxy server
between you and Tomcat.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Via
The "Via" header is being added by a Filter in my application.
Do you control the network between you and the server? I remember how
in old times some mobile operators used to insert ads into HTTP
traffic. Or there might be some antivirus / anti-ads software running
as a proxy on your own computer (Those usually intercept well-known
port numbers, such as 80, 8080).
I control the network. This is actually all localhost traffic as well :)
1. You may configure the access log to log values of specific headers
- to make sure that those are actually sent by your Tomcat.
(Content-Length, Transfer-Encoding).
I'm connecting directly to my localhost Tomcat's NIO port. I don't think
anything else is getting in between my curl/nc and Tomcat.
2. Try remote debugging?
I'd love to, but what am I looking for? If I had seen the "committed"
flag set to "true" at some point, I would look for a value-change as a
trigger to see what's causing it.
I just commented-out everything in the Filter mentioned above other than
the chain.doFilter() call and nothing has changed (other than the Via
header is now absent from the response).
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org