Closed Bug 1367177 Opened 2 years ago Closed 2 years ago
Request .on Before Send Headers event fires too early, before the request is finalized
In Chrome, webRequest.onBeforeSendHeaders event fires as late as possible. In fact, the documentation states that a TCP connection might already be established at this point and merely data hasn't been sent yet. This is not the case for the Firefox implementation which uses the http-on-modify-request observer notification. If you look at the code (https://dxr.mozilla.org/mozilla-central/rev/5bc1c758ab57c1885dceab4e7837e58af27b998c/netwerk/protocol/http/nsHttpChannel.cpp#6274), there is plenty of stuff happening after http-on-modify-request, e.g. the Connection header is being added. Also, HSTS is applied after http-on-modify-request meaning that you might see an HTTP URL even though the request goes to HTTPS. This part actually prevents porting my Enforce Encryption extension to Web Extensions even though the port works well in Chrome.
shane is discussing in bug 1353489, dependency bug 1368527 seems like root cause for both
Priority: -- → P3
Whiteboard: [webRequest] triaged
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1368527
You need to log in before you can comment on or make changes to this bug.