1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 14:48:11 +00:00
serenity/Userland/Libraries/LibWeb/Loader
Karol Kosek eb41f0144b AK: Decode data URLs to separate class (and parse like every other URL)
Parsing 'data:' URLs took it's own route. It never set standard URL
fields like path, query or fragment (except for scheme) and instead
gave us separate methods called `data_payload()`, `data_mime_type()`,
and `data_payload_is_base64()`.

Because parsing 'data:' didn't use standard fields, running the
following JS code:

    new URL('#a', 'data:text/plain,hello').toString()

not only cleared the path as URLParser doesn't check for data from
data_payload() function (making the result be 'data:#a'), but it also
crashes the program because we forbid having an empty MIME type when we
serialize to string.

With this change, 'data:' URLs will be parsed like every other URLs.
To decode the 'data:' URL contents, one needs to call process_data_url()
on a URL, which will return a struct containing MIME type with already
decoded data! :^)
2023-08-01 14:19:05 +02:00
..
ContentFilter.cpp Browser+Ladybird+LibWeb: Port content filters to String 2023-04-22 12:32:40 +02:00
ContentFilter.h Browser+Ladybird+LibWeb: Port content filters to String 2023-04-22 12:32:40 +02:00
FileRequest.cpp LibWeb+WebContent: Do not reference-count file request objects 2023-02-01 14:04:44 +00:00
FileRequest.h LibWeb+WebContent: Do not reference-count file request objects 2023-02-01 14:04:44 +00:00
FrameLoader.cpp LibWeb: Move document loading into separate file 2023-05-03 09:39:49 +02:00
FrameLoader.h LibWeb: Add Page::has_ongoing_navigation() 2023-05-30 20:40:23 +02:00
LoadRequest.cpp AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
LoadRequest.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
ProxyMappings.cpp Everywhere: Rename to_{string => deprecated_string}() where applicable 2022-12-06 08:54:33 +01:00
ProxyMappings.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
Resource.cpp LibWeb: Set Content-Type for data: URLs instead of checking MIME on load 2023-08-01 14:19:05 +02:00
Resource.h LibWeb: Remove ImageLoader and ImageResource 2023-06-11 20:37:12 +02:00
ResourceLoader.cpp AK: Decode data URLs to separate class (and parse like every other URL) 2023-08-01 14:19:05 +02:00
ResourceLoader.h Everywhere: Correctly report progress of downloads larger than 4GiB 2023-06-19 06:13:19 +02:00