1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:25:10 +00:00
serenity/Userland/Libraries/LibWeb/Fetch/Fetching
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
..
Checks.cpp LibWeb/Fetch: Port infrastructure to new String 2023-03-03 09:25:34 +00:00
Checks.h
Fetching.cpp AK: Decode data URLs to separate class (and parse like every other URL) 2023-08-01 14:19:05 +02:00
Fetching.h LibWeb/Fetch: Pass recursive=false to manual navigation redirect 2023-04-24 13:38:37 +01:00
PendingResponse.cpp LibWeb+Browser+Ladybird: Use JS::SafeFunction for EventLoop callbacks 2023-04-21 20:44:47 +01:00
PendingResponse.h LibJS: Handle both const and non-const Ts in Handle<T>::create() 2023-03-06 13:05:43 +00:00
RefCountedFlag.cpp LibWeb: Implement most of the 'Fetching' AOs 2022-10-30 20:10:29 +00:00
RefCountedFlag.h LibWeb: Implement most of the 'Fetching' AOs 2022-10-30 20:10:29 +00:00