Closed Bug 1349151 Opened 3 years ago Closed 3 years ago

webRequest APIs HttpHeaders behave different compared to chromes WebRequest API

Categories

(WebExtensions :: Untriaged, defect)

52 Branch
defect
Not set

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1323036

People

(Reporter: stefan.pieck, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce:

Used WebRequest Extension API, and compared the results to the same requests in Chrome.

The Requested page had multiple set-cookie headers.

Compared Firefox 52.0.1 (32-Bit)  and Chrome 57.0.2987.110 (64-bit)




Actual results:

responseHeaders in Chrome:
[
  {"name":"Date","value":"Tue, 21 Mar 2017 09:09:57 GMT"},
  {"name":"Server","value":"Apache"},
  {"name":"X-Powered-By","value":"PHP/5.4.36-0+deb7u3"},
  {"name":"Set-Cookie","value":"one=first+value"},
  {"name":"Set-Cookie","value":"two=second+value"},
  {"name":"Set-Cookie","value":"three=value%09containing%09tabs"},
  {"name":"Set-Cookie","value":"four=value%0Acontaining%0Alinebreaks"},
  {"name":"Content-Length","value":"123"},
  {"name":"Keep-Alive","value":"timeout=5, max=100"},
  {"name":"Connection","value":"Keep-Alive"},
  {"name":"Content-Type","value":"text/html"}
]

responseHeaders in Firefox: 
[
  {"name":"date","value":"Tue, 21 Mar 2017 09:14:06 GMT"},
  {"name":"server","value":"Apache"},
  {"name":"x-powered-by","value":"PHP/5.4.36-0+deb7u3"},
  {"name":"set-cookie","value":"one=first+value\ntwo=second+value\nthree=value%09containing%09tabs\nfour=value%0Acontaining%0Alinebreaks"},
  {"name":"content-length","value":"123"},
  {"name":"keep-alive","value":"timeout=5, max=100"},
  {"name":"connection","value":"Keep-Alive"},
  {"name":"content-type","value":"text/html"}
]


Expected results:

First I would expect multiple set-cookie entries, instead of one containing all values concatenated with \n.

Further I would expect the names to equal case sensitive, or a hint regarding the difference in the documentation.
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webRequest/HttpHeaders
Component: Untriaged → WebExtensions: Untriaged
Product: Firefox → Toolkit
(In reply to stefan.pieck from comment #0)
> First I would expect multiple set-cookie entries, instead of one containing
> all values concatenated with \n.

Firefox never sends multiple headers with the same name. Concatenating the value has the same spec-defined effect.

> Further I would expect the names to equal case sensitive, or a hint
> regarding the difference in the documentation.
> https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webRequest/
> HttpHeaders

HTTP headers are required by spec to be handled case insensitively.
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1323036
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.