File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ headers: HeaderHashMap = .empty,
6363pub const HeadersInit = union (enum ) {
6464 // List of Pairs of []const u8
6565 strings : []const [2 ][]const u8 ,
66+ // Mappings
67+ mappings : Env.JsObject ,
6668 headers : * Headers ,
6769};
6870
@@ -80,6 +82,19 @@ pub fn constructor(_init: ?HeadersInit, page: *Page) !Headers {
8082 try headers .put (arena , key , value );
8183 }
8284 },
85+ .mappings = > | obj | {
86+ var iter = obj .nameIterator ();
87+ while (try iter .next ()) | name_value | {
88+ const name = try name_value .toString (arena );
89+ const value = Env.Value {
90+ .js_context = page .main_context ,
91+ .value = name_value .value ,
92+ };
93+ const value_string = try value .toString (arena );
94+
95+ try headers .put (arena , name , value_string );
96+ }
97+ },
8398 .headers = > | hdrs | {
8499 var iter = hdrs .headers .iterator ();
85100 while (iter .next ()) | entry | {
You can’t perform that action at this time.
0 commit comments