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

Issue 555383003: [Regression fix] [Data URI parser] Accept data URI with invalid mediatype data (Closed)

Created:
6 years, 3 months ago by tyoshino (SeeGerritForStatus)
Modified:
6 years, 2 months ago
Reviewers:
asanka
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin (slow to review)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

[Regression fix] [Data URI parser] Accept data URI with invalid mediatype data r272022 introduced grammar check on the mediatype part in a data URI. This broke applications that depend on the behavior that our WebURLLoaderImpl and URLRequestDataJob accept data URIs with incomplete mediatype such as "data:image;base64,xxx". Accept this kind of data URI again for backward compatibility. Instead, fallback to the default mediatype when ParseMimeTypeWithoutParameter() returns false in DataURL::Parse() to avoid generating Content-type header with invalid mediatype. BUG=412479 Committed: https://crrev.com/5469386eaa6bd55fcd5540c570fb535f4d6667e3 Cr-Commit-Position: refs/heads/master@{#297593}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Fixed InvalidMimeType unittest #

Total comments: 2

Patch Set 4 : Addressed #17 #

Patch Set 5 : Refined the comment #

Total comments: 2

Patch Set 6 : Addressed #20 #

Patch Set 7 : Fixed unit tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -13 lines) Patch
M net/base/data_url.h View 1 2 3 4 1 chunk +17 lines, -2 lines 0 comments Download
M net/base/data_url.cc View 1 2 3 4 5 1 chunk +8 lines, -2 lines 0 comments Download
M net/base/data_url_unittest.cc View 1 2 3 4 5 6 2 chunks +22 lines, -7 lines 0 comments Download
M net/url_request/url_request_data_job_unittest.cc View 1 2 3 1 chunk +7 lines, -2 lines 0 comments Download

Messages

Total messages: 26 (5 generated)
tyoshino (SeeGerritForStatus)
6 years, 3 months ago (2014-09-12 23:38:02 UTC) #2
mmenke
I'm not at all familiar with this code. Could you have someone a bit more ...
6 years, 3 months ago (2014-09-15 14:17:50 UTC) #3
tyoshino (SeeGerritForStatus)
OK. Adding asanka@ and darin@
6 years, 3 months ago (2014-09-15 14:31:32 UTC) #5
tyoshino (SeeGerritForStatus)
Before r272022, we were not returning Content-type header to data URI request. So, we can ...
6 years, 3 months ago (2014-09-15 14:34:33 UTC) #6
tyoshino (SeeGerritForStatus)
Even if we conclude that invalid mediatypes should be rejected, I'd like to have some ...
6 years, 3 months ago (2014-09-15 15:53:21 UTC) #7
tyoshino (SeeGerritForStatus)
Wrote Blink site test, too: https://codereview.chromium.org/579673002/
6 years, 3 months ago (2014-09-17 05:29:16 UTC) #8
tyoshino (SeeGerritForStatus)
Hmm. On the bug, we received another request to make it accept image\png (not image/png) ...
6 years, 3 months ago (2014-09-18 08:55:21 UTC) #10
tyoshino (SeeGerritForStatus)
Fixed the unittest failed for the patch set 2. Confirmed that data URI with image\png ...
6 years, 3 months ago (2014-09-18 17:15:43 UTC) #11
tyoshino (SeeGerritForStatus)
On 2014/09/18 17:15:43, tyoshino wrote: > Fixed the unittest failed for the patch set 2. ...
6 years, 3 months ago (2014-09-22 14:54:47 UTC) #13
asanka
On 2014/09/22 14:54:47, tyoshino wrote: > On 2014/09/18 17:15:43, tyoshino wrote: > > Fixed the ...
6 years, 3 months ago (2014-09-22 20:35:47 UTC) #14
tyoshino (SeeGerritForStatus)
On 2014/09/22 20:35:47, asanka wrote: > On 2014/09/22 14:54:47, tyoshino wrote: > > On 2014/09/18 ...
6 years, 3 months ago (2014-09-22 22:52:16 UTC) #15
asanka
https://codereview.chromium.org/555383003/diff/40001/net/base/data_url.cc File net/base/data_url.cc (left): https://codereview.chromium.org/555383003/diff/40001/net/base/data_url.cc#oldcode71 net/base/data_url.cc:71: } else if (!ParseMimeTypeWithoutParameter(*mime_type, NULL, NULL)) { As mentioned ...
6 years, 2 months ago (2014-09-24 00:11:38 UTC) #16
tyoshino (SeeGerritForStatus)
PTAL https://codereview.chromium.org/555383003/diff/40001/net/base/data_url.cc File net/base/data_url.cc (left): https://codereview.chromium.org/555383003/diff/40001/net/base/data_url.cc#oldcode71 net/base/data_url.cc:71: } else if (!ParseMimeTypeWithoutParameter(*mime_type, NULL, NULL)) { On ...
6 years, 2 months ago (2014-09-24 05:43:29 UTC) #17
tyoshino (SeeGerritForStatus)
Updated the comment on DataURL::Parse() as asanka@ suggested on the bug.
6 years, 2 months ago (2014-09-24 17:12:34 UTC) #18
tyoshino (SeeGerritForStatus)
ping
6 years, 2 months ago (2014-09-29 03:15:01 UTC) #19
asanka
Sorry about the delay. Just one more compliance requirement and then we should be good. ...
6 years, 2 months ago (2014-09-30 18:35:51 UTC) #20
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/555383003/diff/80001/net/base/data_url.cc File net/base/data_url.cc (right): https://codereview.chromium.org/555383003/diff/80001/net/base/data_url.cc#newcode73 net/base/data_url.cc:73: mime_type->assign("text/plain"); On 2014/09/30 18:35:51, asanka wrote: > If you ...
6 years, 2 months ago (2014-10-01 01:03:54 UTC) #21
asanka
lgtm
6 years, 2 months ago (2014-10-01 03:02:05 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/555383003/120001
6 years, 2 months ago (2014-10-01 03:08:20 UTC) #24
commit-bot: I haz the power
Committed patchset #7 (id:120001) as 2036de077c45a06dd07a8e1a1d3ab4978ec60611
6 years, 2 months ago (2014-10-01 04:01:42 UTC) #25
commit-bot: I haz the power
6 years, 2 months ago (2014-10-01 04:02:24 UTC) #26
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/5469386eaa6bd55fcd5540c570fb535f4d6667e3
Cr-Commit-Position: refs/heads/master@{#297593}

Powered by Google App Engine
This is Rietveld 408576698