aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-07 21:21:18 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-07 21:21:18 -0700
commit812424bf4606cee0554278ee759c939b8e7f216f (patch)
treeab06e4344eaedbfd67ba76480dae74d04bbf8652 /src
parent8af05c28a3dea66df24a7e818a7d5c9ecd4ddc5a (diff)
downloadbun-812424bf4606cee0554278ee759c939b8e7f216f.tar.gz
bun-812424bf4606cee0554278ee759c939b8e7f216f.tar.zst
bun-812424bf4606cee0554278ee759c939b8e7f216f.zip
Fix crash with file descriptor
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/webcore/response.zig16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/bun.js/webcore/response.zig b/src/bun.js/webcore/response.zig
index da5458505..e649bb923 100644
--- a/src/bun.js/webcore/response.zig
+++ b/src/bun.js/webcore/response.zig
@@ -867,11 +867,9 @@ const PathOrBlob = union(enum) {
pub fn fromJS(ctx: js.JSContextRef, args: *JSC.Node.ArgumentsSlice, exception: js.ExceptionRef) ?PathOrBlob {
if (JSC.Node.PathOrFileDescriptor.fromJS(ctx, args, exception)) |path| {
- return PathOrBlob{ .path = .{
- .path = .{
- .string = bun.PathString.init((bun.default_allocator.dupeZ(u8, path.path.slice()) catch unreachable)[0..path.path.slice().len]),
- },
- } };
+ return PathOrBlob{
+ .path = path,
+ };
}
const arg = args.nextEat() orelse return null;
@@ -887,11 +885,9 @@ const PathOrBlob = union(enum) {
pub fn fromJSNoCopy(ctx: js.JSContextRef, args: *JSC.Node.ArgumentsSlice, exception: js.ExceptionRef) ?PathOrBlob {
if (JSC.Node.PathOrFileDescriptor.fromJS(ctx, args, exception)) |path| {
- return PathOrBlob{ .path = .{
- .path = .{
- .string = bun.PathString.init(path.path.slice()),
- },
- } };
+ return PathOrBlob{
+ .path = path,
+ };
}
const arg = args.nextEat() orelse return null;