Commit Graph

264 Commits

Author SHA1 Message Date
Linus Groh
0aca69853c LibWeb: Add abort algorithm after creating controller in fetch_impl()
This ensures that the controller GCPtr is non-null by the time we
capture a copy of it for the lambda passed to the request signal's
add_abort_algorithm() method. Currently, the VERIFY() would always fail
when aborting the signal. The alternative to this would be adding a cell
setter to Handle, and ensuring that null handles have a HandleImpl as
well; this seems not worth the hassle right now. Thanks to Lubrsi for
catching this!

Co-authored-by: Luke Wilde <lukew@serenityos.org>
2022-11-04 22:35:45 +00:00
Linus Groh
6cd57d4c15 LibWeb: Properly copy method and headers from the input in Request()
We were accidentally copying these from the newly created Request
object's underlying request, to itself. Thanks to Lubrsi for catching
this!

Co-authored-by: Luke Wilde <lukew@serenityos.org>
2022-11-04 22:35:45 +00:00
Linus Groh
216f68c566 LibWeb: Register PendingResponse with a Request to keep it alive
This was an oversight from when I converted PendingResponse and various
other classes from being ref-counted to GC-allocated last minute - no
one takes care to keep all of them alive. Some are on the stack, and
some might be captured in another PendingResponse's JS::SafeFunction,
but ultimately, we need a better solution.
Since a PendingResponse is *always* the result of someone having created
a Request, let's just let that keep a list of each PendingResponse that
has been created for it, and visit them until they are resolved. After
that, they can be GC'd with no complaints.
2022-11-01 20:14:12 +00:00
Linus Groh
a1de15498d LibWeb: Use proper origins in Request::has_redirect_tainted_origin()
URL::url_origin() is a globally available function now, so let's use it!
2022-10-31 18:04:11 +00:00
Linus Groh
acfb546048 LibWeb: Handle currently ignored WebIDL::ExceptionOr<T>s 2022-10-31 14:12:44 +00:00
Linus Groh
1de1d6423b LibWeb: Implement the fetch() method :^)
With so much infrastructure implemented, we can finally add the last
piece of this puzzle - the fetch() method itself!

This contains a few hundred lines of generated code as handling the
RequestInfo and RequestInfo parameter types manually is not feasible,
but we can't use the IDL definition as the Window object is handwritten
code at the moment.
It's neatly tucked away in Bindings/ and will be removed eventually.
2022-10-30 20:10:29 +00:00
Linus Groh
c8d121fa32 LibWeb: Implement most of the 'Fetching' AOs
This implements the following operations from section 4 of the Fetch
spec (https://fetch.spec.whatwg.org/#fetching):

- Fetch
- Main fetch
- Fetch response handover
- Scheme fetch
- HTTP fetch
- HTTP-redirect fetch
- HTTP-network-or-cache fetch (without caching)

It does *not* implement:

- HTTP-network fetch
- CORS-preflight fetch

Instead, we let ResourceLoader handle the actual networking for now,
which isn't ideal, but certainly enough to get enough functionality up
and running for most websites to not complain.
2022-10-30 20:10:29 +00:00
Linus Groh
32e0f0aec8 LibWeb: Require error message for Response::network_error()
There will be a lot of different cases where we'll return an error
response, and having a customized Promise rejection message seems quite
useful.

Note that this has to be distinct from the existing 'status message',
which is required to be empty in those cases.
2022-10-30 20:10:29 +00:00
Linus Groh
caa13bf41d LibWeb: Fix URL parsing in Response::location_url()
We need to use URLParser in order to provide a base URL. This makes it
work for the common case of `Location: /some/path`.
2022-10-30 20:10:29 +00:00
Linus Groh
fd042dce55 LibWeb: Actually extract Location header in Response::location_url() 2022-10-30 20:10:29 +00:00
Linus Groh
455aa34011 LibWeb: Partially implement 'Extract header (list) values' AOs
The header-specific ABNF rules are completely ignored for now, but we
can at least extract a single header value, which at least works for
simple cases like `Location`-based redirects.
2022-10-30 20:10:29 +00:00
Linus Groh
14e722617c LibWeb: Implement 'Queue a fetch task' AO 2022-10-30 20:10:29 +00:00
Linus Groh
6deb5ce9b5 LibWeb: Implement 'Default User-Agent value' AO 2022-10-30 20:10:29 +00:00
Linus Groh
5ee9feb9cf LibWeb: Implement 'Append a request Origin header' AO 2022-10-30 20:10:29 +00:00
Linus Groh
c93e6ea0d9 LibWeb: Implement 'Appropriate network error' AO 2022-10-30 20:10:29 +00:00
Linus Groh
361ab205fa LibWeb: Implement 'CORS check' / 'TAO check' AOs 2022-10-30 20:10:29 +00:00
Linus Groh
5d86eae119 LibWeb: Implement 'fetch params' struct 2022-10-30 20:10:29 +00:00
Linus Groh
ba31547fa0 LibWeb: Implement container class for fetch algorithms 2022-10-30 20:10:29 +00:00
Linus Groh
dd5d3e2f4f LibWeb: Implement 'fetch controller' struct 2022-10-30 20:10:29 +00:00
Linus Groh
fef331a03f LibWeb: Implement 'fetch timing info' struct 2022-10-30 20:10:29 +00:00
Linus Groh
1f8ed8fca7 LibWeb: Implement 'connection timing info' struct 2022-10-30 20:10:29 +00:00
Linus Groh
cc6eaafe6b LibWeb: Implement 'Byte sequence as body' AO 2022-10-30 20:10:29 +00:00
Linus Groh
dcded8d39f LibWeb: Implement 'Safely extract BodyInit' AO 2022-10-30 20:10:29 +00:00
Linus Groh
58ad6de954 LibWeb: Implement 'Should response be blocked due to nosniff?' AO 2022-10-30 20:10:29 +00:00
Linus Groh
7e46150a71 LibWeb: Implement 'Should response be blocked due to its MIME type?' AO 2022-10-30 20:10:29 +00:00
Linus Groh
62228f0870 LibWeb: Implement 'Should request be blocked due to a bad port' AO 2022-10-30 20:10:29 +00:00
Linus Groh
55315d72f7 LibWeb: Explain the use-URL-credentials flag
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/a388348
2022-10-30 14:51:58 +00:00
Linus Groh
d2deb8fa6d LibWeb: Add has-cross-origin-redirects flag to Fetch::Infra::Response
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/7c30987
2022-10-30 14:51:58 +00:00
Linus Groh
793a1f5994 LibWeb: Actually define Blob-to-ReadableStream conversion
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/4cd70cf
2022-10-30 14:48:32 +00:00
Linus Groh
b1968b8bed LibWeb: Make Fetch::Infrastructure::{Request,Response,HeaderList} GC'd
This is the way.

On a more serious note, there's no reason to keep adding ref-counted
classes to LibWeb now that the majority of classes is GC'd - it only
adds the risk of discovering some cycle down the line, and forces us to
use handles as we can't visit().
2022-10-30 11:30:23 +00:00
Linus Groh
6ce08d3f75 LibWeb: Use StringView literals for all WebIDL::SimpleExceptions 2022-10-29 15:48:46 +01:00
Luke Wilde
5cc190ad70 LibWeb: Make Fetch::Request follow abort signals where appropriate 2022-10-26 18:49:41 +01:00
Linus Groh
419eb7ab97 LibWeb: Fix unchecked Variant access in Request::construct_impl()
We need to keep an Infrastructure::Request::BodyType around as we're not
sure what's actually inside, instead accessing Infrastructure::Body
directly.

Co-authored-by: Luke Wilde <lukew@serenityos.org>
2022-10-26 10:36:48 +01:00
Linus Groh
16136f0bdd LibWeb: Fix incorrect peek offset in HeaderList::get_decode_and_split()
We want to look at the current character, not the next one.
2022-10-26 10:36:48 +01:00
Linus Groh
7e7def71c1 LibWeb: Use getters instead of direct member access in Response methods
This fixes the behavior of those methods for FilteredResponse subclasses
as those only override the getter methods, not their private members.
2022-10-24 22:58:37 +01:00
Linus Groh
8f8fcfee1a LibWeb: Also make non-const Response getters virtual
We wouldn't want a filtered response to bypass the overridden methods
based on constness.
2022-10-24 22:58:37 +01:00
Linus Groh
0a186cb460 LibWeb: Handle filtered response in Response::clone() 2022-10-24 22:58:37 +01:00
Linus Groh
e40c8f550f LibWeb: Add non-const variants of Request::{current_,}url() 2022-10-24 22:58:37 +01:00
Linus Groh
9ad6031bca LibWeb: Move internal response in FilteredResponse create() functions 2022-10-24 09:26:16 +01:00
Linus Groh
02a4cba086 LibWeb: Use MUST() for infallible ByteBuffer::copy() invocations
ByteBuffer has an inline capacity of 32 bytes, so when we provide a
string smaller than that, it cannot fail.
2022-10-24 09:26:16 +01:00
Linus Groh
65f5c7adbc LibWeb: Add Fetch::Infrastructure::Header::from_string_pair() helper
This allows us to use this:

```cpp
auto header = TRY_OR_RETURN_OOM(realm,
    Infrastructure::Header::from_string_pair(name, value));
```

Instead of the somewhat unwieldly:

```cpp
auto header = Infrastructure::Header {
    .name = TRY_OR_RETURN_OOM(realm, ByteBuffer::copy(name.bytes())),
    .value = TRY_OR_RETURN_OOM(realm, ByteBuffer::copy(value.bytes())),
};
```
2022-10-24 09:26:16 +01:00
Linus Groh
c12c6fd5ea LibWeb: Fix typo in Fetch::Infrastructure::Request::add_range_header() 2022-10-24 09:24:15 +01:00
Linus Groh
950d2fccf0 LibWeb: Remove workaround for nested BodyInit IDL union type 2022-10-21 12:11:24 +02:00
Linus Groh
acc1c2b3cb LibWeb/Fetch: Add "webidentity" destination for FedCM
This is a change in the Fetch spec.

See:
- https://github.com/whatwg/fetch/commit/30d462d
- https://github.com/whatwg/fetch/commit/7487a97
2022-10-15 12:15:31 +02:00
Linus Groh
5995a9fd06 LibWeb/Fetch: Add duplex property to Request
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/1fbc40c
2022-10-15 12:15:31 +02:00
Linus Groh
60e9790a40 LibWeb/Fetch: Add support for parsing a single range header value
This is a change in the Fetch spec.

See:
- https://github.com/whatwg/fetch/commit/2d080d7
- https://github.com/whatwg/fetch/commit/a18fb3e
2022-10-15 12:15:31 +02:00
Ben Wiederhake
3aeb57ed09 AK+Everywhere: Fix data corruption due to code-point-to-char conversion
In particular, StringView::contains(char) is often used with a u32
code point. When this is done, the compiler will for some reason allow
data corruption to occur silently.

In fact, this is one of two reasons for the following OSS Fuzz issue:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49184
This is probably a very old bug.

In the particular case of URLParser, AK::is_url_code_point got confused:
    return /* ... */ || "!$&'()*+,-./:;=?@_~"sv.contains(code_point);
If code_point is a large code point that happens to have the correct
lower bytes, AK::is_url_code_point is then convinced that the given
code point is okay, even if it is actually problematic.

This commit fixes *only* the silent data corruption due to the erroneous
conversion, and does not fully resolve OSS-Fuzz#49184.
2022-10-09 10:37:20 -06:00
Sam Atkins
0823a3c422 BindingsGenerator+LibWeb: Pass a VM to static IDL-based functions
This saves us from having to yoink the VM out of thin air.
2022-10-06 21:45:07 +01:00
Linus Groh
1c12f5c31d LibWeb: Make Fetch::Infrastructure::{Request,Response} ref-counted
With the addition of the 'fetch params' struct, the single ownership
model we had so far falls apart completely.

Additionally, this works nicely for FilteredResponse's internal response
instead of risking a dangling reference.

Replacing the public constructor with a create() function also found a
few instances of a Request being stack-allocated!
2022-10-05 09:14:49 +01:00
Linus Groh
886ca9c7b6 LibWeb: Add missing Request::policy_container() getter and setter 2022-10-05 09:14:49 +01:00
Linus Groh
16d6c62193 LibWeb: Make Fetch::Infrastructure::Request::set_client() take a pointer 2022-10-05 09:14:49 +01:00
Linus Groh
72a752685f LibWeb: Add missing link to Fetch::Infrastructure::Response member 2022-10-05 09:14:49 +01:00
Linus Groh
7b50e96434 LibWeb: Add missing links to Fetch::Infrastructure::Request members 2022-10-05 09:14:49 +01:00
Linus Groh
fc9d587e39 LibJS: Make PromiseCapability GC-allocated
A struct with three raw pointers to other GC'd types is a pretty big
liability, let's just turn this into a Cell itself.
This comes with the additional benefit of being able to capture it in
a lambda effortlessly, without having to create handles for individual
members.
2022-10-02 23:02:27 +01:00
Linus Groh
c2326ec95a LibJS: Move PromiseCapability into its own cpp/h file
This is not strictly connected to PromiseReaction in any way.
Preparation before doing some actual work on it :^)
2022-10-02 23:02:27 +01:00
Andrew Kaster
56b381aac0 LibWeb: Cleanup unecessary uses and includes of HTML::Window
The big global refactor left some stragglers behind for atomicity.

Clean up the rest, and remove a ton of includes of LibWeb/HTML/Window.h
2022-10-01 21:05:32 +01:00
Andrew Kaster
4bb6345b2f LibWeb: Remove unecessary dependence on Window from assorted classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct Crypto, Encoding, HRT, IntersectionObserver,
NavigationTiming, Page, RequestIdleCallback, Selection, Streams, URL,
and XML classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
4878a18ee7 LibWeb: Remove unecessary dependence on Window from Fetch, XHR, FileAPI
These classes only needed Window to get at its realm. Pass a realm
directly to construct Fetch, XMLHttpRequest and FileAPI classes.
2022-10-01 21:05:32 +01:00
Linus Groh
0b52b883af LibWeb: Implement '5.5. Response class' from the Fetch API :^) 2022-09-27 14:56:17 +01:00
Linus Groh
9fb672e981 LibWeb: Implement '5.4. Request class' from the Fetch API :^) 2022-09-27 14:56:17 +01:00
Linus Groh
5ad6283331 LibWeb: Implement '5.3. Body mixin' from the Fetch API :^)
This will be used to share functionality between Request and Response.
2022-09-27 14:56:17 +01:00
Linus Groh
afe2563e2b LibWeb: Make HeaderList ref-counted
This is needed to eventually share a header list between a Request or
Response object's internal infra request/response and the object's
exposed Header object.
2022-09-27 14:56:17 +01:00
Linus Groh
2d57d47132 LibWeb: Make Fetch::Infrastructure::Request::m_method default to "GET"
ByteBuffer has an inline capacity of 32 bytes, so this isn't fallible
and can be done inline.
2022-09-27 14:56:17 +01:00
Linus Groh
924d7721f0 LibWeb: Stub out Fetch::Infrastructure::Body::fully_read_as_promise() 2022-09-27 14:56:17 +01:00
Linus Groh
a7164f2674 LibWeb: Stub out Fetch::Infrastructure::Body::clone() 2022-09-27 14:56:17 +01:00
Linus Groh
ef5e2eb794 LibWeb: Implement Fetch::Infrastructure::Response::clone() 2022-09-27 14:56:17 +01:00
Linus Groh
b5e8e9b30b LibWeb: Support ReadonlyBytes as argument for extract_body()
This now matches the spec's requirement of "a byte sequence or BodyInit
object object".
2022-09-27 14:56:17 +01:00
Linus Groh
fd52119ca3 LibWeb: Add getters and setters for Fetch::Header's members 2022-09-27 14:56:17 +01:00
Linus Groh
dc6fb43d26 LibWeb: Add referrer policy to Fetch::Infrastructure::Request
The enum is in its own directory and namespace as there's a standalone
spec for it, that will later also house AOs.

- https://w3c.github.io/webappsec-referrer-policy/
- https://www.w3.org/TR/referrer-policy/
2022-09-27 14:56:17 +01:00
Linus Groh
a602a4c780 LibWeb: Heap-allocate returned Fetch::Infrastructure::{Request,Response}
A Request/Response instance should always be heap-allocated and have
clear ownership, so let's also wrap it in a NonnullOwnPtr instead of
putting them on the stack.
2022-09-27 14:56:17 +01:00
Linus Groh
88ee15a497 LibWeb: Mark two Fetch::Infrastructure::Request getters as const 2022-09-27 14:56:17 +01:00
Linus Groh
ad04d7ac9b LibWeb: Move ExceptionOr from DOM/ to WebIDL/
This is a concept fully defined in the Web IDL spec and doesn't belong
in the DOM directory/namespace - not even DOMException, despite the name
:^)
2022-09-25 19:13:31 +01:00
Linus Groh
6480faacb6 LibWeb: Move IDLAbstractOperations from Bindings/ to WebIDL/ 2022-09-24 19:31:39 +01:00
Linus Groh
76ace3629a LibWeb: Make Fetch::Infrastructure::Body::stream() const 2022-09-22 21:01:13 +01:00
Linus Groh
54a987ad45 LibWeb: Update extract_body() to use BodyInit 2022-09-22 21:01:13 +01:00
Linus Groh
8f5620b5d9 LibWeb: Add BodyInit union type 2022-09-22 21:01:13 +01:00
Linus Groh
571f4e3ebb LibWeb: Move extract_body() into Fetch 2022-09-22 21:01:13 +01:00
Linus Groh
f98ce156c4 LibWeb: Remove ReadableStreamDummy in favor of ReadableStream 2022-09-22 21:01:13 +01:00
Linus Groh
1ace80235b LibWeb: Move XMLHttpRequestBodyInit into Fetch
https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
2022-09-22 21:01:13 +01:00
Linus Groh
edfef8e2f5 Everywhere: Rename WrapperGenerator to BindingsGenerator
This code generator no longer creates JS wrappers for platform objects
in the old sense, instead they're JS objects internally themselves.
Most of what we generate now are prototypes - which can be seen as
bindings for the internal C++ methods implementing getters, setters, and
methods - as well as object constructors, i.e. bindings for the internal
create_with_global_object() method.

Also tweak the naming of various CMake glue code existing around this.
2022-09-21 23:06:08 +01:00
Linus Groh
4270ede7c4 LibWeb: Remove WRAPPER_HACK() macro
We no longer access Bindings::FooWrapper anywhere for a Foo platform
object, so these can be removed :^)
2022-09-21 21:12:24 +01:00
Andreas Kling
010be491a9 LibWeb: Fix e-mail address mishap 2022-09-21 18:42:09 +02:00
Andreas Kling
66f4e2b3b0 LibWeb: Add two more scheme helpers to the Fetch infrastructure 2022-09-21 11:51:18 +02:00
Andreas Kling
9683da4470 LibWeb: Add referrer accessors to Fetch Request 2022-09-20 14:48:07 +02:00
Andreas Kling
497ead37bc LibWeb: Make DOMException GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
96f6c7fae5 LibWeb: Make Headers and HeadersIterator GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
647ac1bdba LibWeb: Make Blob and File GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
6f433c8656 LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated
This is a monster patch that turns all EventTargets into GC-allocated
PlatformObjects. Their C++ wrapper classes are removed, and the LibJS
garbage collector is now responsible for their lifetimes.

There's a fair amount of hacks and band-aids in this patch, and we'll
have a lot of cleanup to do after this.
2022-09-06 00:27:09 +02:00
Linus Groh
b345a0acca LibJS+LibWeb: Reduce use of GlobalObject as an intermediary
- Prefer VM::current_realm() over GlobalObject::associated_realm()
- Prefer VM::heap() over GlobalObject::heap()
- Prefer Cell::vm() over Cell::global_object()
- Prefer Wrapper::vm() over Wrapper::global_object()
- Inline Realm::global_object() calls used to access intrinsics as they
  will later perform a direct lookup without going through the global
  object
2022-08-23 13:58:30 +01:00
Linus Groh
40a70461a0 LibWeb: Replace GlobalObject with Realm in wrapper functions
Similar to create() in LibJS, wrap() et al. are on a low enough level to
warrant passing a Realm directly instead of relying on the current realm
from the VM, as a wrapper may need to be allocated while no JS is being
executed.
2022-08-23 13:58:30 +01:00
Linus Groh
ccdfa2320c LibJS: Replace GlobalObject with VM in Iterator AOs [Part 7/19] 2022-08-23 13:58:30 +01:00
Linus Groh
f3117d46dc LibJS: Remove GlobalObject from VM::throw_completion()
This is a continuation of the previous five commits.

A first big step into the direction of no longer having to pass a realm
(or currently, a global object) trough layers upon layers of AOs!
Unlike the create() APIs we can safely assume that this is only ever
called when a running execution context and therefore current realm
exists. If not, you can always manually allocate the Error and put it in
a Completion :^)

In the spec, throw exceptions implicitly use the current realm's
intrinsics as well: https://tc39.es/ecma262/#sec-throw-an-exception
2022-08-23 13:58:30 +01:00
Linus Groh
b99cc7d050 LibJS+LibWeb: Replace GlobalObject with Realm in create() functions
This is a continuation of the previous two commits.

As allocating a JS cell already primarily involves a realm instead of a
global object, and we'll need to pass one to the allocate() function
itself eventually (it's bridged via the global object right now), the
create() functions need to receive a realm as well.
The plan is for this to be the highest-level function that actually
receives a realm and passes it around, AOs on an even higher level will
use the "current realm" concept via VM::current_realm() as that's what
the spec assumes; passing around realms (or global objects, for that
matter) on higher AO levels is pointless and unlike for allocating
individual objects, which may happen outside of regular JS execution, we
don't need control over the specific realm that is being used there.
2022-08-23 13:58:30 +01:00
Linus Groh
042dfc7284 LibWeb: Move extract_mime_type() from XMLHttpRequest to HeaderList
Except some minor tweaks, this is a direct copy of Luke's initial
implementation in XMLHttpRequest, now replacing the former.
2022-07-20 18:03:21 +01:00
Linus Groh
69d324d46a LibWeb: Fix accidental (name, name) header in Headers::fill()
This makes two more WPT tests pass here:
http://wpt.live/fetch/api/headers/headers-basic.any.html
2022-07-20 18:03:21 +01:00
Linus Groh
ed49b66f25 LibWeb: Implement '5.1. Headers class' from the Fetch API :^) 2022-07-19 00:27:35 +01:00
Linus Groh
b5ab1f6b4a LibWeb: Implement HeaderList::sort_and_combine() 2022-07-19 00:27:35 +01:00
Linus Groh
bad6ad8861 LibWeb: Implement CaseInsensitiveBytesTraits::equals()
Turns out HashTable::contains() doesn't solely use hash() for equality
checks, so the lack of a proper equals() implementation broke the check
in convert_header_names_to_a_sorted_lowercase_set() and caused duplicate
entries in header_names_set.
2022-07-19 00:27:35 +01:00
Linus Groh
2726fc9c73 LibWeb: Move Fetch infra into the Web::Fetch::Infrastructure namespace
The Fetch spec unfortunately will cause a name clash between the Request
concept and the Request JS object - both cannot live in the Web::Fetch
namespace, and WrapperGenerator generally assumes `Web::<Name>` for
things living in the `<Name>/` subdirectory, so let's instead move infra
code into its own namespace - it already sits in a (sub-)subdirectory
anyway.
2022-07-19 00:27:35 +01:00
Linus Groh
58fda93ea2 LibWeb: Add Blob to Fetch's Body::SourceType variant 2022-07-18 08:11:25 +01:00
Linus Groh
8da3914bdc LibWeb: Add definitions from '2.2.6. Responses' in the Fetch spec 2022-07-16 21:05:00 +01:00
Linus Groh
7116a7d2bf LibWeb: Add definitions from '2.2.5 Requests' in the Fetch spec 2022-07-15 14:15:30 +02:00
Linus Groh
4f02bac39c LibWeb: Add a couple of missing includes to Fetch's Headers.h 2022-07-15 14:15:30 +02:00
Linus Groh
f507f68d4a LibWeb: Add definitions from '2.2.4. Bodies' in the Fetch spec
...at least the ones that don't require an implementation of the Streams
spec :^)
2022-07-14 00:42:26 +01:00
Linus Groh
1694279dd8 LibWeb: Add definitions from '2.2.3. Statuses' in the Fetch spec 2022-07-14 00:42:26 +01:00
Linus Groh
dd9bf10151 LibWeb: Add definitions from '2.2.2. Headers' in the Fetch spec 2022-07-14 00:42:26 +01:00
Linus Groh
9244f1697d LibWeb: Add definitions from '2.2.1. Methods' in the Fetch spec 2022-07-14 00:42:26 +01:00
Linus Groh
9d60010b44 LibWeb: Mark Fetch::collect_an_http_quoted_string() [[nodiscard]] 2022-07-14 00:42:26 +01:00
Linus Groh
f42f0cceaa LibWeb: Make Fetch::collect_an_http_quoted_string()'s 2nd param optional 2022-07-14 00:42:26 +01:00
Linus Groh
fad69fcacd LibWeb: Move Fetch::collect_an_http_quoted_string() into HTTP.{cpp,h}
The Fetch spec is too big to have a generic AbstractOperations.{cpp,h}
file, so let's keep AOs in their section-specific files.
2022-07-14 00:42:26 +01:00
Linus Groh
e3798886ed LibWeb: Add & use 'HTTP whitespace' from '2.2. HTTP' in the Fetch spec
We had two independent definitions of this already, both referring to
the Fetch spec.
2022-07-14 00:42:26 +01:00
Linus Groh
df3e25f1bb LibWeb: Add & use 'HTTP tab or space' from '2.2. HTTP' in the Fetch spec 2022-07-14 00:42:26 +01:00
Linus Groh
7c2c9b6859 LibWeb: Add definitions from '2.1. URL' in the Fetch spec 2022-07-14 00:42:26 +01:00
Luke Wilde
8cfeca5261 LibWeb: Implement spec-compliant MIME type struct and parser
This will be used by XHR to extract the Content-Type MIME type to
retrieve the charset.
2022-02-12 12:53:28 +01:00