diff options
Diffstat (limited to 'src/bun.js/webcore/request.zig')
-rw-r--r-- | src/bun.js/webcore/request.zig | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bun.js/webcore/request.zig b/src/bun.js/webcore/request.zig index 6581649fc..d6484d2ba 100644 --- a/src/bun.js/webcore/request.zig +++ b/src/bun.js/webcore/request.zig @@ -399,7 +399,7 @@ pub const Request = struct { .Null = {}, }; } else { - if (Body.Init.init(getAllocator(globalThis), globalThis, arguments[0], url_or_object_type) catch null) |req_init| { + if (Body.Init.init(getAllocator(globalThis), globalThis, arguments[0]) catch null) |req_init| { request.headers = req_init.headers; request.method = req_init.method; } @@ -439,7 +439,7 @@ pub const Request = struct { } } - if (Body.Init.init(getAllocator(globalThis), globalThis, arguments[1], arguments[1].jsType()) catch null) |req_init| { + if (Body.Init.init(getAllocator(globalThis), globalThis, arguments[1]) catch null) |req_init| { request.headers = req_init.headers; request.method = req_init.method; } @@ -494,6 +494,12 @@ pub const Request = struct { return &this.body; } + pub fn getFetchHeaders( + this: *Request, + ) ?*FetchHeaders { + return this.headers; + } + pub fn doClone( this: *Request, globalThis: *JSC.JSGlobalObject, |