You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In browser.zig, the HTTP response's content type is base only on content-type HTTP header.
If the header is missing, we assume the content type is text/html.
But we should instead implement Mime sniff to detect the current document's mime type.
The text was updated successfully, but these errors were encountered:
krichprollsch
changed the title
Implement Mime sniffing to determine the resource mime type and charset
Implement Mime sniffing to determine the resource mime type
Apr 14, 2025
This change implements MIME type sniffing according to the WHATWG spec:
https://mimesniff.spec.whatwg.org/#determining-the-computed-mime-type-of-a-resource
Key changes:
- Add MIME sniffing functionality to mime.zig with binary signature detection
- Update browser.zig to use sniffing when Content-Type header is missing
- Add tests for various content types
- Improve content handling and buffering
Fixeslightpanda-io#512
mime type
In
browser.zig
, the HTTP response's content type is base only oncontent-type
HTTP header.If the header is missing, we assume the content type is
text/html
.But we should instead implement Mime sniff to detect the current document's mime type.
The text was updated successfully, but these errors were encountered: