Commit db744f5
Remove onHeadersReceived listener
The onHeadersReceived listener served one purpose:
Secure cookies set via HTTPS (not HTTP, not JS)
This task is already handled by:
- onBeforeSendHeaders (blocking) which should secure cookies
- onCookieChanged (non-blocking) which secures any cookies on create/update
Moreover, the current function is broken:
- We look for a case-sensitive "Set-Cookie," but many servers send only a
lowercase "set-cookie" (e.g. Google, Twitter, ...)
- "; Secure" is frequently not the end of the cookie (old #L192)
By removing this function, here's what happens for different cookie types:
- Set by HTTP
No change, wasn't ever handled by onHeadersReceived
- Set by Javascript
No change, wasn't ever handled by onHeadersReceived
- Set by HTTPS
Now (as before) secured by onCookieChanged (non-blocking, so maybe a tiny
window for a race to steal the cookie, but ...)
Secured by onBeforeSendHeaders (blocking)
Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>1 parent b865eca commit db744f5
1 file changed
+0
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | 180 | | |
210 | 181 | | |
211 | 182 | | |
| |||
279 | 250 | | |
280 | 251 | | |
281 | 252 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | 253 | | |
288 | 254 | | |
289 | 255 | | |
| |||
0 commit comments