Closed Bug 740801 Opened 14 years ago Closed 1 month ago

Multiple cookies are returned by getResponseHeader separated by a carriage return

Categories

(Core :: Networking: Cookies, defect, P5)

x86_64
Windows 7
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mkaply, Unassigned)

Details

(Whiteboard: [necko-would-take])

According to the code here: https://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpHeaderArray.h#189 Requesting Set_Cookie headers with getResponseHeader returns the cookies separated by a carriage returns (versus ', ' for the rest of the spec). This means that if you do: request.setResponseHeader("Set-Cookie", request.getResponseHeader("Set-Cookie")); it fails if there are multiple cookies. if getResponseHeader can return values with carriage returns, setResponseHeader should be smart enough to accept values with carriage returns. At the bare minimum, this behavior should at least be documented somewhere.
Whiteboard: [necko-would-take]
Priority: -- → P5
Severity: normal → S3

Closing WONTFIX. Set-Cookie is now a forbidden response-header name per the Fetch standard, so getResponseHeader("Set-Cookie") and getAllResponseHeaders() omit it entirely from web content. The roundtrip scenario this bug describes is no longer reachable. Chrome-privileged code needing cookie data should use nsICookieService or read from the nsIHttpChannel directly rather than going through XHR header strings.

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.