Skip to content

Commit 3527eaf

Browse files
Jake ChampionJakeChampion
authored andcommitted
fix: Make Response.redirect headers be immutable
1 parent 18053aa commit 3527eaf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

runtime/js-compute-runtime/builtins/request-response.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,6 +2423,7 @@ bool Response::redirect(JSContext *cx, unsigned argc, JS::Value *vp) {
24232423
if (!builtins::Headers::maybe_add(cx, headers, "location", url_str.begin())) {
24242424
return false;
24252425
}
2426+
JS::SetReservedSlot(headers, static_cast<uint32_t>(builtins::Headers::Slots::Immutable), JS::TrueValue());
24262427
JS::SetReservedSlot(response, static_cast<uint32_t>(Slots::Headers), JS::ObjectValue(*headers));
24272428
JS::SetReservedSlot(response, static_cast<uint32_t>(Slots::Redirected), JS::FalseValue());
24282429
// 8. Return responseObject.

0 commit comments

Comments
 (0)