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

Issue 2694373003: Normalize UriData.parse result. (Closed)

Created:
3 years, 10 months ago by Lasse Reichstein Nielsen
Modified:
3 years, 10 months ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Normalize UriData.parse result. Validates base64 encoding, normalizes padding. Normalizes non-base64 data using URI percent-escapes for all invalid characters. Fixes issue #28728, #28700 BUG= http://dartbug.com/28728 http://dartbug.com/28700 R=floitsch@google.com Committed: https://github.com/dart-lang/sdk/commit/dccdd1b981b88fa6996e964848fda7c83be1e3be

Patch Set 1 #

Patch Set 2 : Merge to head. #

Total comments: 9

Patch Set 3 : Address comments. Fix bug. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+356 lines, -84 lines) Patch
M CHANGELOG.md View 1 1 chunk +4 lines, -0 lines 0 comments Download
M sdk/lib/convert/base64.dart View 1 2 2 chunks +135 lines, -1 line 0 comments Download
M sdk/lib/convert/convert.dart View 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/core/uri.dart View 32 chunks +119 lines, -62 lines 0 comments Download
M sdk/lib/internal/internal.dart View 1 chunk +27 lines, -0 lines 0 comments Download
M tests/corelib/data_uri_test.dart View 1 2 3 chunks +70 lines, -21 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
Lasse Reichstein Nielsen
3 years, 10 months ago (2017-02-15 08:39:38 UTC) #2
floitsch
LGTM. https://codereview.chromium.org/2694373003/diff/20001/sdk/lib/convert/base64.dart File sdk/lib/convert/base64.dart (right): https://codereview.chromium.org/2694373003/diff/20001/sdk/lib/convert/base64.dart#newcode73 sdk/lib/convert/base64.dart:73: * * Validate that the length is correct ...
3 years, 10 months ago (2017-02-15 17:03:10 UTC) #3
Lasse Reichstein Nielsen
Committed patchset #3 (id:40001) manually as dccdd1b981b88fa6996e964848fda7c83be1e3be (presubmit successful).
3 years, 10 months ago (2017-02-17 10:02:44 UTC) #5
Lasse Reichstein Nielsen
3 years, 10 months ago (2017-02-17 11:22:09 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/2694373003/diff/20001/sdk/lib/convert/base64....
File sdk/lib/convert/base64.dart (right):

https://codereview.chromium.org/2694373003/diff/20001/sdk/lib/convert/base64....
sdk/lib/convert/base64.dart:73: * * Validate that the length is correct (a
multiplum of four).
On 2017/02/15 17:03:09, floitsch wrote:
> multiple ?

Done.

https://codereview.chromium.org/2694373003/diff/20001/sdk/lib/convert/base64....
sdk/lib/convert/base64.dart:92: originalChar = -1;
It's actually not necessary to set it at all - a '%' isn't a valid character
anyway, so the only thing originalChar is compared to below is `=`, which it
isn't.

https://codereview.chromium.org/2694373003/diff/20001/sdk/lib/convert/base64....
sdk/lib/convert/base64.dart:97: char = 0;  // Invalid.
I'll set it to -1, so it'll just fall through to the throw below without wasting
time in the valid-char checks below.
No need to duplicate that throw.

https://codereview.chromium.org/2694373003/diff/20001/sdk/lib/convert/base64....
sdk/lib/convert/base64.dart:172: "Invalid base64 padding, padded length must be
multiplum of four, "
On 2017/02/15 17:03:09, floitsch wrote:
> multiple

Done.

Powered by Google App Engine
This is Rietveld 408576698