-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Gateway content type detection : ODS documents served as ZIP (MIME) #7252
Comments
Sounds like a great idea! |
Definitely room for improvement. |
At first sight it seems you are mixing Content-Encoding and Content-Type @xmaysonnave ? For browsers to deflate on the fly, I think Content-Type should still be html, and Content-Encoding gzip. If you add a gzip file directly to ipfs... well, the content type will be gzip. |
@hsanjuan Thanks for your fast reply. You're right it probably needs to be more detailed. 1 - added from js-ipfs-http-client block mode no filename specified. https://ipfs.bluelightav.org/ipfs/bafybeif2cdpb7jbcaeuzohsmsegvilsjmki4lmly4wqhmviudul23uwlra?filename=index.html From Infura (no Content-Encoding in each test) https://ipfs.infura.io/ipfs/bafybeicvunyrpfm5kcgsoldsfd7olgiogq5zlkviiokx7e3hekfe32nmue?filename=index.html Now the test with an index.html.gz https://ipfs.infura.io/ipfs/QmQ2x72Nw9oDhrPckfdbbjBEc6WiB3gqrnRZqmqxHMdmVS?filename=index.html.gz 2 - added an index.html.gz on my local server with curl From my local web server then: https://ipfs.bluelightav.org/ipfs/QmeeqFYbLabqZA2KjmFTCRfAVpv4kjgRHNistw63V6Jp4X?filename=index.html.gz Notice that the content type is different Hope it clarifies the situation. Once I start playing with gz content I do not have any Content-Encoding. Maybe the current issue is not related. Thanks |
If you add a gzipped file, then this is a It opens an number of questions: accessing /ipfs/Qmxxx on the gateway with the browser, saving it and adding it to IPFS would result in a different hash because deflating magic has happened, which is weird. Probably compression should be handled at the nginx level, like you do (seems infura doesn't). But in any case -> open a new issue for that please. |
can i work on this issue if it's not already assigned? |
Issued a PR: #7262 |
@hsanjuan Thanks for your feedback. I'll open a feature request. |
Fixes #7252 - Uses gabriel-vasile/mimetype to support additional content types
Version information: 0.5.0
Description:
It seems
http.DetectContentType
does not work well for these types.We could switch to https://github.com/gabriel-vasile/mimetype ? (also see https://stackoverflow.com/a/52266327 for more options). Unsure if there is a reason have have sticked with the current detector.
Related #2164
Reported at https://discuss.ipfs.io/t/bugs-in-0-5-0-regarding-file-names-types/7845
The text was updated successfully, but these errors were encountered: