New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect handling of multiple headers #19
Comments
Thanks for pointing this out! Probably should add a way to split these up when storing the headers. This seems sufficient for replay, and actually to be more accurate it should probably save the cookies from document.cookie itself, as only those cookies that are accessible to the document are needed for replay... |
Huh, did not see that. That makes sense. So for replay it doesn't really matter (assuming the |
…ected presetCookie after existing injected cookies from x-wabac-preset-cookie header. - parse multiple comma separated cookies, as mentioned in webrecorder/archiveweb.page#19 - exclude HttpOnly cookies, as they won't be available in document.cookie - exclude Secure cookies that are passed to http domain likely fix for webrecorder/replayweb.page#30
…ected presetCookie after existing injected cookies from x-wabac-preset-cookie header. - parse multiple comma separated cookies, as mentioned in webrecorder/archiveweb.page#19 - exclude HttpOnly cookies, as they won't be available in document.cookie - exclude Secure cookies that are passed to http domain likely fix for webrecorder/replayweb.page#30 bump to 2.6.4
While implementing firefox support, I noticed the following:
The CDP Network.Headers interface returns headers as a JSON object of keys and values, while the webRequest API returns a list of keys and values.
HTTP Headers can appear multiple times though, so how does CDP handle multiple of the same header?
I tested this with a tiny test server, and when the response contains two values for the same header:
The following is stored in the database:
The headers are concatted simply with comma. This seems to be "correct" for most headers, but not all of them. For set-cookie for example, the cookies are mangled and not parseable. This means that the resulting web archive will set mangled cookies.
I found some more info here:
https://stackoverflow.com/a/38406581/2639190
The text was updated successfully, but these errors were encountered: