aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/webcore/blob.zig
diff options
context:
space:
mode:
authorGravatar Ai Hoshino <ambiguous404@gmail.com> 2023-10-04 03:03:57 +0800
committerGravatar GitHub <noreply@github.com> 2023-10-03 12:03:57 -0700
commitb7982ac1318937560f38e0f8eb18f45eaa43480f (patch)
tree5fbc3eaf2d3b77df2846228dc9eabf1ccd53c5c8 /src/bun.js/webcore/blob.zig
parent60e7ae9aee8e6f0952c17cd0c2c3bd9aeb7297a8 (diff)
downloadbun-b7982ac1318937560f38e0f8eb18f45eaa43480f.tar.gz
bun-b7982ac1318937560f38e0f8eb18f45eaa43480f.tar.zst
bun-b7982ac1318937560f38e0f8eb18f45eaa43480f.zip
fix(blob): Add the current offset to the new blob. (#6259)
Close: #6252
Diffstat (limited to 'src/bun.js/webcore/blob.zig')
-rw-r--r--src/bun.js/webcore/blob.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig
index b0f1df935..1e0720ea6 100644
--- a/src/bun.js/webcore/blob.zig
+++ b/src/bun.js/webcore/blob.zig
@@ -3003,12 +3003,13 @@ pub const Blob = struct {
}
}
+ const offset = this.offset +| @as(SizeType, @intCast(relativeStart));
const len = @as(SizeType, @intCast(@max(relativeEnd -| relativeStart, 0)));
// This copies over the is_all_ascii flag
// which is okay because this will only be a <= slice
var blob = this.dupe();
- blob.offset = @as(SizeType, @intCast(relativeStart));
+ blob.offset = offset;
blob.size = len;
// infer the content type if it was not specified