Use 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.* Review URL: https://codereview.chromium.org/1315643005 Cr-Commit-Position: refs/heads/master@{#347896}
Showing
Please register or sign in to comment