Request an XHTML representation, get redirected to a JSON representation

Bug #704214 reported by Leonard Richardson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lazr.restful
Fix Released
High
Leonard Richardson

Bug Description

If you make a request from a web browser that results in an HTTP redirect, the ws.accept header is supposed to be set to the value of your request's "Accept" header. Actually, it's set to the value of the *response*'s "Accept" header. Since "Accept" isn't a response header, the default (application/json) is used. This means that you can ask for an XHTML representation on your initial request and end up asking for a JSON representation when you follow the redirect.

Related branches

Revision history for this message
Leonard Richardson (leonardr) wrote :

This manifests in Launchpad when you change the target of a bug using the AJAX form. The browser makes the POST request asking for an XHTML representation, but changing the target of the bug changes its URL, and Launchpad sends back a redirect with ws.accept=application/json. The browser gets the JSON representation and tries to treat it like an XHTML representation, causing a crash.

Changed in lazr.restful:
status: New → In Progress
Tim Penhey (thumper)
Changed in lazr.restful:
status: In Progress → Fix Released
importance: Undecided → High
assignee: nobody → Leonard Richardson (leonardr)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.