Skip to content

Commit bd8104c

Browse files
author
Guy Bedford
authored
fix: prepare_for_entries_modification ordering (#226)
1 parent f52f274 commit bd8104c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

builtins/web/fetch/headers.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,11 +836,12 @@ bool Headers::append(JSContext *cx, unsigned argc, JS::Value *vp) {
836836
}
837837

838838
if (is_valid) {
839+
// name casing must come from existing name match if there is one.
840+
auto idx = Headers::lookup(cx, self, name_chars);
841+
839842
if (!prepare_for_entries_modification(cx, self))
840843
return false;
841844

842-
// name casing must come from existing name match if there is one.
843-
auto idx = Headers::lookup(cx, self, name_chars);
844845
if (idx) {
845846
// set-cookie doesn't combine
846847
if (header_compare(name_chars, set_cookie_str) == Ordering::Equal) {

0 commit comments

Comments
 (0)