[jetty-dev] [jira] (JETTY-1515) DefaultServlet: HTTP headers are impossible to include with 304 responses.

"Joakim Erdfelt (JIRA)" <[email protected]>
Newsgroups gmane.comp.java.jetty.general
Message-ID <508296511.77017.1336415703113.JavaMail.j2ee-jira@codehaus01.managed.contegix.com>
    [ https://jira.codehaus.org/browse/JETTY-1515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=298095#comment-298095 ] 

Joakim Erdfelt commented on JETTY-1515:
---------------------------------------

What headers are you wanting to set on a 304 response?

Note: according to the RFC 2616 spec, the 304 response has many restrictions.
https://tools.ietf.org/html/rfc2616

Examples: a 304 response MUST NOT include a message body (section 4.4), and has a limited set of entity-headers that can be used in the response [Date, ETag, Content-Location, Expires, Cache-Control, and/or Vary] (section 10.3.5)

                
> DefaultServlet: HTTP headers are impossible to include with 304 responses.
> --------------------------------------------------------------------------
>
>                 Key: JETTY-1515
>                 URL: https://jira.codehaus.org/browse/JETTY-1515
>             Project: Jetty
>          Issue Type: Bug
>          Components: Servlet
>    Affects Versions: 6.1.12.rc3, 6.1.12.rc4, 6.1.12.rc5, 6.1.12, 6.1.14, 6.1.15.pre0, 6.1.15.rc2, 6.1.15.rc3, 6.1.15.rc4, 6.1.15.rc5, 6.1.15, 6.1.16, 6.1.17, 6.1.18, 6.1.19, 6.1.20, 6.1.21, 6.1.22, 6.1.23, 6.1.24, 6.1.25, 6.1.26, 7.0.2, 7.1.0, 7.1.1, 7.1.2, 7.1.3, 7.1.4, 7.1.5, 7.1.6, 7.2.0, 7.2.1, 7.2.2, 7.3.0, 7.3.1, 7.4.0, 7.4.1, 7.4.2, 7.4.3, 7.4.4, 7.4.5, 7.5.0, 7.5.1, 7.5.2, 7.5.3, 7.5.4, 7.6.0, 7.6.1, 7.6.2, 7.6.3, 8.0.0.M0, 8.0.0.M1, 8.0.0.M2, 8.0.0.M3, 8.0.0.RC0, 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.1.0, 8.1.1, 8.1.2, 8.1.3
>            Reporter: Michael Bosworth
>
> The DefaultServlet has this code in the passConditionalHeaders method:
> //if the content has not been modified
> {
> 	response.reset();
> 	response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
> 	response.flushBuffer();
> 	return false;
> }
> Consequently, it's impossible to add cookies (or a session, or any HTTP header) if the underlying content has not been changed since the last request. 
> One problem this can cause is a spurious authentication failure. If the initially authorized servlet request returns a 304, then a subsequent request needs to reauthorize, since the JSESSIONID never made it back to the browser.
> The issue was introduced by this fix: http://jira.codehaus.org/browse/JETTY-294

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.