Skip to content

Implement Mime sniffing to determine the resource mime type #512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
krichprollsch opened this issue Apr 7, 2025 · 1 comment
Open

Comments

@krichprollsch
Copy link
Member

krichprollsch commented Apr 7, 2025

mime type

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.

@krichprollsch
Copy link
Member Author

relates with #509

@krichprollsch 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
factory-droid-dev bot added a commit to francesca-factory/browser that referenced this issue Apr 16, 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

Fixes lightpanda-io#512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant