data URI parsing mis-detects "base64" parameter as extension

RESOLVED FIXED in mozilla17

Status

()

Core
Networking
--
minor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Julian Reschke, Assigned: felix_moeller)

Tracking

unspecified
mozilla17
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
"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.
(Assignee)

Comment 1

5 years ago
Created attachment 642551 [details] [diff] [review]
Proposed patch, including test case
Attachment #642551 - Flags: review?(rjesup)
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+
Attachment #642551 - Flags: review?(rjesup) → review+
(Assignee)

Comment 3

5 years ago
Created attachment 642585 [details] [diff] [review]
proposed patch

thanks for the review Randell!
Attachment #642551 - Attachment is obsolete: true
Attachment #642585 - Flags: review?(rjesup)

Updated

5 years ago
Attachment #642585 - Flags: review?(rjesup) → review+
(Reporter)

Updated

5 years ago
Keywords: checkin-needed
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
Assignee: nobody → felix_moeller
Flags: in-testsuite+
Keywords: checkin-needed

Comment 5

5 years ago
https://hg.mozilla.org/mozilla-central/rev/eac3221e3e86
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Depends on: 781693
You need to log in before you can comment on or make changes to this bug.