Last Comment Bug 774240 - data URI parsing mis-detects "base64" parameter as extension
: data URI parsing mis-detects "base64" parameter as extension
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Networking (show other bugs)
: unspecified
: All All
: -- minor (vote)
: mozilla17
Assigned To: felix_moeller
:
: Patrick McManus [:mcmanus]
Mentors:
Depends on: 781693
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-16 05:33 PDT by Julian Reschke
Modified: 2012-08-09 18:34 PDT (History)
3 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Proposed patch, including test case (1.25 KB, patch)
2012-07-16 05:58 PDT, felix_moeller
rjesup: review+
Details | Diff | Splinter Review
proposed patch (1.51 KB, patch)
2012-07-16 07:49 PDT, felix_moeller
rjesup: review+
Details | Diff | Splinter Review

Description Julian Reschke 2012-07-16 05:33:34 PDT
"data" URIs (RFC 2397) allow extension parameters; they could be called "base64" but must not be confused with the "base64" extension.

For instance;

  data:text/plain;base64,...

*is* the base64 extension, while

  data:text/plain;base64=xy,...

is not (as indicated by the "=" sign).

See test case:

  <http://greenbytes.de/tech/tc/datauri/#base64param>

This works properly in Chrome and Opera.
Comment 1 felix_moeller 2012-07-16 05:58:59 PDT
Created attachment 642551 [details] [diff] [review]
Proposed patch, including test case
Comment 2 Randell Jesup [:jesup] 2012-07-16 06:07:22 PDT
Comment on attachment 642551 [details] [diff] [review]
Proposed patch, including test case

Change the two constant strings to single a #define BASE64_URI_TAG ";base64" (or some such name), and r+
Comment 3 felix_moeller 2012-07-16 07:49:44 PDT
Created attachment 642585 [details] [diff] [review]
proposed patch

thanks for the review Randell!
Comment 4 Ryan VanderMeulen [:RyanVM] 2012-07-16 17:45:10 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/eac3221e3e86

Thanks for the patch, Felix! One request - for future patches, please follow the directions below. It makes life easier for those committing on your behalf. Thanks again!
https://developer.mozilla.org/en/Creating_a_patch_that_can_be_checked_in
Comment 5 Ed Morley [:emorley] 2012-07-17 02:10:46 PDT
https://hg.mozilla.org/mozilla-central/rev/eac3221e3e86

Note You need to log in before you can comment on or make changes to this bug.