aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-03-07 22:34:24 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-03-07 22:34:24 -0800
commit5b0277b6b87f8b3e74b004524dc9338fc15999c5 (patch)
tree497baacf2fd9bb1761edeb9dc9ff91af970ccc11
parent88ad5ed73cc6e6e0f006905a7e161a942a8ea277 (diff)
downloadbun-5b0277b6b87f8b3e74b004524dc9338fc15999c5.tar.gz
bun-5b0277b6b87f8b3e74b004524dc9338fc15999c5.tar.zst
bun-5b0277b6b87f8b3e74b004524dc9338fc15999c5.zip
Add isASCII check
-rw-r--r--src/bun.js/webcore/blob.zig6
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;
}