Commit graph

15 commits

Author SHA1 Message Date
Andreas Kling 0eb7c24e7d Ladybird: Stop telling Qt to use HTTP pipelining
For some reason, this was causing incomplete HTTP loads in some cases.
As an example, we would only load half of the "Ahem" CSS font from the
wpt.live server when running Acid3.

I only enabled pipelining in the first place because I assumed it would
be a performance boost, but it appears to do more than that.

I suppose there's a reason it's off by default (and most Qt API users
don't bother enabling it.)
2023-05-06 12:49:12 +02:00
Andreas Kling a504ac3e2a Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_case
Let's make it clear that these functions deal with ASCII case only.
2023-03-10 13:15:44 +01:00
Andreas Kling 1379720742 Ladybird: Consider HTTP response a success if it has a status code
The QNetworkReply::NetworkError enum mixes all kinds of errors into one
enum, HTTP errors, network errors, proxy errors, etc.

Instead of caring about it, we now say that HTTP requests were
successful if their response has any HTTP status code attached.

This allows LibWeb to display error pages when using Qt networking.
2023-02-24 19:15:49 +01:00
Luke Wilde c51026a855 Ladybird: Teach RequestManagerQt how to handle every valid HTTP method 2023-02-10 22:18:19 +00:00
Luke Wilde b85f4ab66a Ladybird: Tell Qt that we manually handle the Cookie header
In some cases, Qt would silently drop the Cookie header and start
causing Cookie authenticated requests to start failing.
2022-12-30 23:52:09 +01:00
Linus Groh 5a5c4f079b Ladybird: Update for AK::{String => DeprecatedString} rename 2022-12-25 07:58:58 -07:00
Andreas Kling bc6a6190d8 Ladybird: Disable HTTP2 as it's significantly slower
The slowdown is sometimes 5x, possibly more.

This is trivially confirmed by adding a large JS file to a page and
comparing the load time with a simple wget.
2022-12-25 07:58:58 -07:00
Andreas Kling 6d1db6801c Ladybird/RequestManagerQt: Unwrap multiple cookies masquerading as one
Qt can wrap any number of cookies into a single Set-Cookie header in the
network responses it gives us. We now use the QNetworkReply::header()
API to get a "cooked" list of the cookies, and then rewrap them in a
format suitable for LibWeb.

Sites that send multiple Set-Cookie headers in one response now work
a lot better. :^)
2022-12-25 07:58:58 -07:00
networkException f1c7ee2810 Ladybird/Everywhere: Replace "protocol" with "scheme" url helpers
See 4230dbbb21
2022-12-25 07:58:58 -07:00
Andreas Kling 11e5be050f Ladybird: Enable HTTP pipelining 2022-12-25 07:58:58 -07:00
Andreas Kling 9073d60f00 Ladybird: Actually add request headers to outgoing HTTP requests 2022-12-25 07:58:58 -07:00
Daniel Bertalan af5250b2cb Ladybird: Fix compilation on macOS/Clang
- Silences the -Wuser-defined-literals warning which is triggered by our
  use of the `sv` suffix for StringView
- Removes an unused captured `this` pointer [-Wunused-lambda-capture]
- Changes a JSONArray.h include to JSONObject.h to get the definition
  for `JSONValue::serialize`. This is needed because template functions
  are not exported for dylibs on macOS. This is a hack; the JSON headers
  should be refactored so that each one includes the definition of
  the template functions it sees. -- Maybe we should build with
  -fvisibility-inlines-hidden on Linux to catch issues like this?
2022-12-25 07:58:58 -07:00
Andreas Kling bfc9057638 Ladybird: Tell Qt to let us manage HTTP redirects ourselves 2022-12-25 07:58:58 -07:00
Andreas Kling 2bbf2dfb9a Ladybird: Update for removal of StringView(char const*) 2022-12-25 07:58:58 -07:00
Andreas Kling 419d3ec646 Ladybird: Use QtNetwork for HTTP and HTTPS requests
Until we can get our own RequestServer infrastructure up and running,
running the TLS and HTTP code in-process was causing lots of crashes
due to unexpected reentrancy via nested event loops.

This patch adds a simple backend for HTTP and HTTPS requests that simply
funnels them through QNetworkAccessManager.
2022-12-25 07:58:58 -07:00