Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(749)

Issue 1315643005: Use EnumerateHeaderLines to parse added headers in webRequest API (Closed)

Created:
5 years, 3 months ago by robwu
Modified:
5 years, 3 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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.* Committed: https://crrev.com/4109859acc8f1c514154f167e1251b15f96d6e1e Cr-Commit-Position: refs/heads/master@{#347896}

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -7 lines) Patch
M chrome/browser/extensions/api/web_request/web_request_api_unittest.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api_helpers.cc View 1 chunk +11 lines, -7 lines 4 comments Download

Messages

Total messages: 10 (2 generated)
robwu
Dominic: Please review. Ben: Need a rubber stamp for web_request_api_helpers.cc after Dominic's approval.
5 years, 3 months ago (2015-09-06 21:30:54 UTC) #2
not at google - send to devlin
I can rubberstamp it, but may as well make a couple of comments first https://codereview.chromium.org/1315643005/diff/1/extensions/browser/api/web_request/web_request_api_helpers.cc ...
5 years, 3 months ago (2015-09-08 22:55:34 UTC) #3
robwu
https://codereview.chromium.org/1315643005/diff/1/extensions/browser/api/web_request/web_request_api_helpers.cc File extensions/browser/api/web_request/web_request_api_helpers.cc (right): https://codereview.chromium.org/1315643005/diff/1/extensions/browser/api/web_request/web_request_api_helpers.cc#newcode366 extensions/browser/api/web_request/web_request_api_helpers.cc:366: void* iter = nullptr; On 2015/09/08 22:55:34, kalman wrote: ...
5 years, 3 months ago (2015-09-08 23:00:21 UTC) #4
not at google - send to devlin
rs lgtm, both my comments were made before realising there was another nested loop in ...
5 years, 3 months ago (2015-09-08 23:01:25 UTC) #5
battre
LGTM, sorry for the delay.
5 years, 3 months ago (2015-09-09 03:32:17 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1315643005/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1315643005/1
5 years, 3 months ago (2015-09-09 08:59:21 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 3 months ago (2015-09-09 10:03:33 UTC) #9
commit-bot: I haz the power
5 years, 3 months ago (2015-09-09 10:04:35 UTC) #10
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/4109859acc8f1c514154f167e1251b15f96d6e1e
Cr-Commit-Position: refs/heads/master@{#347896}

Powered by Google App Engine
This is Rietveld 408576698