dev@jersey.java.net

Re: URI //customers// bug

From: Julian Reschke <julian.reschke_at_gmx.de>
Date: Tue, 14 Aug 2007 21:51:53 +0200

Ayub Khan wrote:
> Hi Paul,
>
> comments inline...
>
> Paul Sandoz wrote:
>> Hi Ayub,
>>
>> [Moving to the dev list]
>>
>> Is the problem that the browser is performing an automatic second
>> request in response to the redirect *but* it is not reusing the HTTP
>> accept that was used in the first request ?
> Yes.
>> A browser bug perhaps ?
>>
>> Jakub is working on a fix so we can switch on/off redirection for URI
>> normalization and path canonicalization.
>>
>> This is making me think we should switch off redirection by default...
>>
>> Paul.
> If I am using a XHR, and set the accept to "application/json", I would
> get the response as "application/xml". Looks like XHR is using the 307
> to send second
> request with default mimetype, this may be a XHR bug also. So my client
> code that does the JS call like eval() will fail, because it is
> expecting a JSON content,
> not a XML content.
>
> Note:
>
> Looking a the 307 Definition from
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html, it is not clear
> what should be the right
> behaviour for various browsers. I am using Firefox 2.0.0.6.
>
> Thanks
> Ayub

XHR could return the 30x status. But when it follows the redirect, it
needs to preserve the request headers. I'd raise a bug report, and check
results with Opera/IE/Safari as well.

Best regards, Julian