LibWeb: Encode URL in ResourceLoader::load()

Encode URLs before requesting them - this fixes loading of resources
that have spaces in their URL, for example.
This commit is contained in:
Simon Danner 2021-04-22 20:45:59 +02:00 committed by GitHub
parent 254e010c75
commit 7ab8be9e0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: sideshowbarker 2024-07-18 19:14:23 +09:00

View file

@ -156,7 +156,7 @@ void ResourceLoader::load(const LoadRequest& request, Function<void(ReadonlyByte
headers.set(it.key, it.value);
}
auto download = protocol_client().start_download(request.method(), url.to_string(), headers, request.body());
auto download = protocol_client().start_download(request.method(), url.to_string_encoded(), headers, request.body());
if (!download) {
if (error_callback)
error_callback("Failed to initiate load", {});