diff options
author | 2023-03-07 22:34:24 -0800 | |
---|---|---|
committer | 2023-03-07 22:34:24 -0800 | |
commit | 5b0277b6b87f8b3e74b004524dc9338fc15999c5 (patch) | |
tree | 497baacf2fd9bb1761edeb9dc9ff91af970ccc11 | |
parent | 88ad5ed73cc6e6e0f006905a7e161a942a8ea277 (diff) | |
download | bun-5b0277b6b87f8b3e74b004524dc9338fc15999c5.tar.gz bun-5b0277b6b87f8b3e74b004524dc9338fc15999c5.tar.zst bun-5b0277b6b87f8b3e74b004524dc9338fc15999c5.zip |
Add isASCII check
-rw-r--r-- | src/bun.js/webcore/blob.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig index a593bfe05..5a41f5f8c 100644 --- a/src/bun.js/webcore/blob.zig +++ b/src/bun.js/webcore/blob.zig @@ -2507,11 +2507,15 @@ pub const Blob = struct { globalThis: *JSC.JSGlobalObject, value: JSC.JSValue, ) callconv(.C) bool { - const zig_str = if (value.isString()) + var zig_str = if (value.isString()) value.getZigString(globalThis) else ZigString.Empty; + if (!zig_str.isAllASCII()) { + zig_str = ZigString.Empty; + } + if (zig_str.eql(ZigString.init(this.content_type))) { return true; } |