Skip to content
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

Wrong Content-Type header for SVG images #354

Open
brabiega opened this issue Mar 28, 2021 · 4 comments
Open

Wrong Content-Type header for SVG images #354

brabiega opened this issue Mar 28, 2021 · 4 comments
Labels
Milestone

Comments

@brabiega
Copy link

When serving SVG files plik server sets

Content-Type | text/xml; charset=utf-8

Tested on Firefox 86.0.1, invalid content type prevents proper display of transparency and probably more elements of SVG files.

Content type should be set to "image/svg+xml"
https://www.w3.org/TR/SVG11/mimereg.html

@camathieu camathieu added the bug label Apr 12, 2021
@camathieu camathieu added this to the 1.3.2 milestone Apr 12, 2021
@camathieu
Copy link
Member

Thanks for reporting that. The library we use might be unable to properly detect those files.

@brabiega
Copy link
Author

brabiega commented Aug 1, 2021

Yup, that's the case
golang/go#47492

@brabiega
Copy link
Author

brabiega commented Aug 1, 2021

The funny thing is that mime type is properly set in the DB when upload is created through web GUI (browser sends file type in request body)

POST /upload
{"ttl":2592000,"files":[{"fileName":"zabawka.svg","fileType":"image/svg+xml","fileSize":13243,"reference":"0"}]}

However when later actual file is sent the file type gets detected using net/http.DetectContentType and DB entry is overwritten with wrong fileType.
POST /file/<t1>/<t2>/zabawka.svg

@camathieu
Copy link
Member

camathieu commented Aug 4, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants