mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-20 17:21:52 +00:00
LibWeb: Ensure Headers API can handle non-ascii characters
This patch ensure Headers object's associated header list is ISO-8859-1 encoded when set using `Infra::isomorphic_encode`, and correctly decoded using `Infra::isomorphic_decode`. Follow-up of https://github.com/LadybirdBrowser/ladybird/pull/1893
This commit is contained in:
parent
5e62f548db
commit
824e91ffdb
Notes:
github-actions[bot]
2024-12-11 23:50:13 +00:00
Author: https://github.com/F3n67u
Commit: 824e91ffdb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2814
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/Gingeh ✅
7 changed files with 188 additions and 13 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <LibWeb/Bindings/HeadersIteratorPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Fetch/HeadersIterator.h>
|
||||
#include <LibWeb/Infra/Strings.h>
|
||||
|
||||
namespace Web::Bindings {
|
||||
|
||||
|
@ -65,8 +66,8 @@ GC::Ref<JS::Object> HeadersIterator::next()
|
|||
return create_iterator_result_object(vm(), JS::js_undefined(), true);
|
||||
|
||||
auto const& pair = pairs[m_index++];
|
||||
StringView pair_name { pair.name };
|
||||
StringView pair_value { pair.value };
|
||||
auto pair_name = Infra::isomorphic_decode(pair.name);
|
||||
auto pair_value = Infra::isomorphic_decode(pair.value);
|
||||
|
||||
switch (m_iteration_kind) {
|
||||
case JS::Object::PropertyKind::Key:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue