Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Modify order of headers returned

That's a violation of the RFC2616 - The HTTP/1.1 spec.

"The order in which header fields with differing field names are received is not significant."

Header field order is only relevant when there are multiple message-headers with the same field-name value.

We have no tests in jetty to test for header order beyond the requirement for multiple values across a common name field.
The client library that you are using needs to conform to the HTTP/1.1, as any hack you come up with on the server side will not work reliably or predictably now or in the future.

An ugly hack, which is not guaranteed to work in the latest Jetty 9 (for example), would be to have a javax.servlet.Filter that sets a response Cookie header as the first thing it does before it forwards the request to the javax.servlet.FilterChain.doFilter(request,response).  This *might* have the desired end result you want.  But this behavior is just relying on the unpredictable nature of the order in/out of a java.util.Map implementation, which is unspecified.

Joakim Erdfelt <joakim@xxxxxxxxxxx>
Developer advice, services and support
from the Jetty & CometD experts

On Tue, Feb 19, 2013 at 7:38 AM, Mack Gerhardt <mack@xxxxxxxxxxxxxx> wrote:
Is it possible to modify the actual output stream so that one could modify headers, change order of headers sent?

I have an issue where a client in the field uses a mobile phone with a library that fails on reading in cookies on the latest version of jetty 7,8,9 because the Set-Cookie JSESSIONID header comes right after the request. In a prior version 7.0.2 the Expires header is the first returned before Set-Cookie.

I would like to move up to the latest version of Jetty which is used in an embedded server and modify the actual response being sent back. If you could point me in a direction that would be great.


jetty-users mailing list

Back to the top