content icon indicating copy to clipboard operation
content copied to clipboard

Data URLs sample contains non encoded reserved character

Open garsEstTemps opened this issue 3 years ago • 1 comments

MDN URL

https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs

What specific section or headline is this issue about?

https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs#syntax

What information was incorrect, unhelpful, or incomplete?

Note that I'm not really familiar with the article content (hence that is why I was looking at it) but It seems weird to see the following example containing a non-encoded ; character :

data:text/html,<script>alert('hi');</script>

knowing that before in the section it is explained that :

If the data contains [characters defined in RFC 3986 as reserved characters](https://datatracker.ietf.org/doc/html/rfc3986#section-2.2), or contains space characters, newline characters, or other non-printing characters, those characters must be [percent-encoded](https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding) (aka "URL-encoded").

And opening the RFC link shows you that ; is a reserved character. So I'm wondering whether the example is correct. To me, it looks like it should be rewritten to encode the ; reserved character. If I misunderstood, sorry for the noise.

What did you expect to see?

A correct (not included non encoded reserved character") example (and consistent with the paragraph explaining the reserved character mentioned above).

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
  • Folder: en-us/web/http/basics_of_http/data_urls
  • MDN URL: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs
  • GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/http/basics_of_http/data_urls/index.md
  • Last commit: https://github.com/mdn/content/commit/8e1f45b8c0a3671f6e3de43c0764ad610aa345dd
  • Document last modified: 2022-09-14T09:06:12.000Z

garsEstTemps avatar Nov 06 '22 10:11 garsEstTemps

Thanks for catching this and reporting it — I’ve opened #22123 with a fix.

After that fix is merged, this issue will automatically be marked as resolved, and closed.

sideshowbarker avatar Nov 07 '22 08:11 sideshowbarker