DescriptionUse EnumerateHeaderLines to parse added headers in webRequest API
The responseHeaders that are passed to the webRequest.onHeadersReceived
event are generated by the GetResponseHeadersList method. This method
enumerates the headers using HttpResponseHeaders::EnumerateHeaderLines,
which skips over commas in header values.
But the return value of the webRequest.onHeadersReceived handler is
parsed by HttpResponseHeaders:EnumerateHeader, which stops at commas.
So, if the original response header contains a comma, and the extension
returns the response headers in unmodified form, it was still mistakenly
flagged as modified. This results in duplication of headers.
To fix this, the return value is now parsed using EnumerateHeaderLines.
BUG=526367
TEST=unit_tests --gtest_filter=ExtensionWebRequestHelpersTest.*
Committed: https://crrev.com/4109859acc8f1c514154f167e1251b15f96d6e1e
Cr-Commit-Position: refs/heads/master@{#347896}
Patch Set 1 #
Total comments: 4
Messages
Total messages: 10 (2 generated)
|