mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
[bun.js] If no Content-Type is available and the content is all ascii text, assume it is text/plain
This commit is contained in:
@@ -854,6 +854,8 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
|
||||
MimeType.init(this.blob.content_type)
|
||||
else if (MimeType.sniff(this.blob.sharedView())) |content|
|
||||
content
|
||||
else if (this.blob.is_all_ascii orelse false)
|
||||
MimeType.text
|
||||
else
|
||||
MimeType.other;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user