mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
LibWeb: Port URL and URLSearchParams to new String
This commit is contained in:
parent
843c9d6cd7
commit
9da09e4fd3
12 changed files with 229 additions and 157 deletions
|
@ -90,7 +90,8 @@ WebIDL::ExceptionOr<Infrastructure::BodyWithType> extract_body(JS::Realm& realm,
|
|||
},
|
||||
[&](JS::Handle<URL::URLSearchParams> const& url_search_params) -> WebIDL::ExceptionOr<void> {
|
||||
// Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
|
||||
source = url_search_params->to_deprecated_string().to_byte_buffer();
|
||||
auto search_params_bytes = TRY(url_search_params->to_string()).bytes();
|
||||
source = TRY_OR_THROW_OOM(vm, ByteBuffer::copy(search_params_bytes));
|
||||
// Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
|
||||
type = TRY_OR_THROW_OOM(vm, ByteBuffer::copy("application/x-www-form-urlencoded;charset=UTF-8"sv.bytes()));
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue