mP1 / walkingkooka-net

Beautiful type safe networking abstractions mostly concentrating on http.
Apache License 2.0
0 stars 1 forks source link

dataurl fails to handle MDN Hello World example #500

Closed mP1 closed 3 months ago

mP1 commented 3 months ago

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

A few examples:

[data:,Hello%2C%20World%21](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs#datahello2c20world21)

    The text/plain data Hello, World!. Note how the comma is [URl encoded](https://en.wikipedia.org/wiki/URL_encoding) as %2C, and the space character as %20.
[data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs#datatextplainbase64sgvsbg8sifdvcmxkiq)

    base64-encoded version of the above
[data:text/html,%3Ch1%3EHello%2C%20World%21%3C%2Fh1%3E](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs#datatexthtml3ch13ehello2c20world213c2fh13e)

    An HTML document with <h1>Hello, World!</h1>
[data:text/html,%3Cscript%3Ealert%28%27hi%27%29%3B%3C%2Fscript%3E](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs#datatexthtml3cscript3ealert2827hi27293b3c2fscript3e)

    An HTML document with <script>alert('hi');</script> that executes a JavaScript alert. Note that the closing script tag is required.