diff options
author | 2023-08-07 20:15:53 -0700 | |
---|---|---|
committer | 2023-08-07 20:15:53 -0700 | |
commit | 2fe6a965af394db7228dce56ce29b629c650764c (patch) | |
tree | 9d0df164cd0ffcc2c1000a58aa498476abf0b3c6 /src/js_ast.zig | |
parent | a32097aa9f53f7c8ea1331c61dc2658bc1b11208 (diff) | |
download | bun-2fe6a965af394db7228dce56ce29b629c650764c.tar.gz bun-2fe6a965af394db7228dce56ce29b629c650764c.tar.zst bun-2fe6a965af394db7228dce56ce29b629c650764c.zip |
implement fetching data urls (#4000)
* fetch data urls
* `byteSlice`
* deinit slice
* allocate `mime_type` string if needed
* `content_type_allocated` and uncomment tests
* `str_`
* createAtom and slice decode result
Diffstat (limited to 'src/js_ast.zig')
-rw-r--r-- | src/js_ast.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig index e7466554f..2682c7f2b 100644 --- a/src/js_ast.zig +++ b/src/js_ast.zig @@ -3076,7 +3076,7 @@ pub const Expr = struct { ) !Expr { var bytes = blob.sharedView(); - const mime_type = mime_type_ orelse HTTP.MimeType.init(blob.content_type); + const mime_type = mime_type_ orelse HTTP.MimeType.init(blob.content_type, null, null); if (mime_type.category == .json) { var source = logger.Source.initPathString("fetch.json", bytes); @@ -9794,10 +9794,10 @@ pub const Macro = struct { if (value.jsType() == .DOMWrapper) { if (value.as(JSC.WebCore.Response)) |resp| { - mime_type = HTTP.MimeType.init(resp.mimeType(null)); + mime_type = HTTP.MimeType.init(resp.mimeType(null), null, null); blob_ = resp.body.use(); } else if (value.as(JSC.WebCore.Request)) |resp| { - mime_type = HTTP.MimeType.init(resp.mimeType()); + mime_type = HTTP.MimeType.init(resp.mimeType(), null, null); blob_ = resp.body.value.use(); } else if (value.as(JSC.WebCore.Blob)) |resp| { blob_ = resp.*; |