ladybird/Userland/Libraries/LibWeb/Fetch
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
..
Fetching AK: Decode data URLs to separate class (and parse like every other URL) 2023-08-01 14:19:05 +02:00
Infrastructure LibWeb: Add interface for 'concept-url-parser' 2023-07-15 09:45:16 +02:00
Body.cpp LibWeb: Update workarounds for the empty execution context stack 2023-07-06 15:18:50 -04:00
Body.h LibWeb/Fetch: Implement Body's "fully read" function from the spec 2023-03-07 11:51:12 +00:00
Body.idl LibWeb: Implement '5.3. Body mixin' from the Fetch API :^) 2022-09-27 14:56:17 +01:00
BodyInit.cpp LibWeb: Add FormData support to XHR 2023-04-05 09:43:52 +01:00
BodyInit.h LibWeb: Add FormData support to XHR 2023-04-05 09:43:52 +01:00
BodyInit.idl LibWeb: Add FormData support to XHR 2023-04-05 09:43:52 +01:00
Enums.cpp LibWeb: Implement '5.5. Response class' from the Fetch API :^) 2022-09-27 14:56:17 +01:00
Enums.h LibWeb: Implement '5.5. Response class' from the Fetch API :^) 2022-09-27 14:56:17 +01:00
FetchMethod.cpp LibWeb: Update workarounds for the empty execution context stack 2023-07-06 15:18:50 -04:00
FetchMethod.h LibWeb/HTML: Port Window.fetch() to IDL 2023-03-07 23:33:34 +00:00
Headers.cpp Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_case 2023-03-10 13:15:44 +01:00
Headers.h LibWeb/Fetch: Port JS interfaces to new String 2023-03-03 09:25:34 +00:00
Headers.idl LibWeb/Fetch: Port JS interfaces to new String 2023-03-03 09:25:34 +00:00
HeadersIterator.cpp LibJS+LibWeb: Move IteratorOperations.h AOs to Iterator.h 2023-07-19 14:11:43 +01:00
HeadersIterator.h LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr 2023-03-15 08:48:49 +01:00
Request.cpp LibWeb: Add interface for 'concept-url-parser' 2023-07-15 09:45:16 +02:00
Request.h LibWeb/HTML: Port Window.fetch() to IDL 2023-03-07 23:33:34 +00:00
Request.idl LibWeb/Fetch: Port JS interfaces to new String 2023-03-03 09:25:34 +00:00
Response.cpp LibWeb: Add interface for 'concept-url-parser' 2023-07-15 09:45:16 +02:00
Response.h LibWeb/HTML: Port Window.fetch() to IDL 2023-03-07 23:33:34 +00:00
Response.idl LibWeb/Fetch: Port JS interfaces to new String 2023-03-03 09:25:34 +00:00