Jason - your Content-Legth example puzzled me.
In HTTP1.1, the Content-Length on a response refers to the entity length and transfer length. Both apply to the body of the response, and exclude headers.
So, it should be perfectly leagal to say
response.setHeader("Host", "localhost"); response.setHeader("Pragma", "no-cache"); response.setHeader("Content-Length", "0"); response.setHeader("Location", "http://www.apache.org");
The client should then receive four headers with no response body.
The servlet spec is free to say that the response should be closed after the third header, but it seems quite odd to specify such behavior.
Subbu Allamaraju
|