mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Implement formData() method steps for x-www-form-urlencoded
The Response interface of the Fetch API can now parse form urlencoded bodies when Content-Type is set to 'application/x-www-form-urlencoded'.
This commit is contained in:
parent
7047fcf761
commit
b8fa572c67
Notes:
github-actions[bot]
2024-07-23 07:03:35 +00:00
Author: https://github.com/kennethmyhra
Commit: b8fa572c67
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/763
5 changed files with 46 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Kenneth Myhra <kennethmyhra@serenityos.org>
|
||||
* Copyright (c) 2023-2024, Kenneth Myhra <kennethmyhra@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -40,6 +40,16 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<FormData>> FormData::construct_impl(JS::Rea
|
|||
return realm.heap().allocate<FormData>(realm, realm, move(entry_list));
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<FormData>> FormData::create(JS::Realm& realm, Vector<DOMURL::QueryParam> entry_list)
|
||||
{
|
||||
Vector<FormDataEntry> list;
|
||||
list.ensure_capacity(entry_list.size());
|
||||
for (auto& entry : entry_list)
|
||||
list.unchecked_append({ .name = move(entry.name), .value = move(entry.value) });
|
||||
|
||||
return construct_impl(realm, move(list));
|
||||
}
|
||||
|
||||
FormData::FormData(JS::Realm& realm, Vector<FormDataEntry> entry_list)
|
||||
: PlatformObject(realm)
|
||||
, m_entry_list(move(entry_list))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue