Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Do not sniff mime types #239

Merged
merged 1 commit into from
Feb 21, 2023
Merged

Do not sniff mime types #239

merged 1 commit into from
Feb 21, 2023

Conversation

swsnr
Copy link
Owner

@swsnr swsnr commented Feb 21, 2023

Instead rely on the Content-Type header (remote resources) and the file extension (local resources) to identify SVG images. This removes the dependency on the file tool and on libmagic, and also the entire magic module, which simplifies the code and the build a bit, and removes a runtime dependency.

It also effectively enables SVG images on Windows which so far did mostly not work because Windows neither includes the file tool nor libmagic, so users had to go out of their way and install file/libmagic to get SVG images support on Windows.

@swsnr swsnr self-assigned this Feb 21, 2023
@swsnr swsnr force-pushed the do-not-sniff-mimetypes branch 2 times, most recently from 8de6fd2 to 173388d Compare February 21, 2023 19:56
@swsnr swsnr enabled auto-merge February 21, 2023 19:56
Instead rely on the Content-Type header (remote resources) and the file
extension (local resources) to identify SVG images.  This removes the
dependency on the file tool and on libmagic, and also the entire magic
module, which simplifies the code and the build a bit, and removes a
runtime dependency.

It also effectively enables SVG images on Windows which so far did
mostly not work because Windows neither includes the file tool nor
libmagic, so users had to go out of their way and install file/libmagic
to get SVG images support on Windows.
@swsnr swsnr force-pushed the do-not-sniff-mimetypes branch from 173388d to 2e7ca7b Compare February 21, 2023 21:11
@swsnr swsnr merged commit dbb9cc5 into main Feb 21, 2023
@swsnr swsnr deleted the do-not-sniff-mimetypes branch February 21, 2023 21:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant