-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
filetype: caddy is misinterpreting epub as zip #3959
Comments
Thanks for opening an issue! We'll look into this. It's not immediately clear to me what is going on, so I'll need your help to understand it better. Ideally, we need to be able to reproduce the bug in the most minimal way possible. This allows us to write regression tests to verify the fix is working. If we can't reproduce it, then you'll have to test our changes for us until it's fixed -- and then we can't add test cases, either. I've attached a template below that will help make this easier and faster! This will require some effort on your part -- please understand that we will be dedicating time to fix the bug you are reporting if you can just help us understand it and reproduce it easily. This template will ask for some information you've already provided; that's OK, just fill it out the best you can. 👍 I've also included some helpful tips below the template. Feel free to let me know if you have any questions! Thank you again for your report, we look forward to resolving it! Template
Instructions -- please heed otherwise we cannot help you (help us help you!)
Example of a tutorial: Create a config file: |
1. Environment1a. Operating system and version
1b. Caddy version (run
|
Hmmm, there must be some mistake -- the template is only about half filled out. Be sure to enable debug mode, you will get more logs. Also please provide the problematic epub file. |
How are you building Caddy? What happens if you use I have a hunch that this is likely a browser bug rather than a bug with Caddy. |
It happens with on every epub i have tried. |
I am not. I got it from the Termux's package manager.
I can't test it now. But |
It can be. This issue doesn't happen on Chromium on Linux. |
Ok. Considering epub is actually just a zip file (has the same header), the Go standard library is auto-detecting it as a zip file to set the Content-Type header. Your browser is then initiating a download and adding the .zip extension. You can avoid this multiple ways:
This isn't an issue with Caddy, so I'll close it now. |
I am now middle of no where, who should i blame - myself, go, chromium on android. |
But this issue doesn't occur on chromium on linux. |
That's probably because your Linux system's mime.types file has an epub entry. If it were a Caddy bug, something like this would be behaving the same on all platforms. |
When i ran a caddy file-server (with directory listing enabled) on my android device and visit the webpage from another android device and downloaded an epub, the file extention of epub was changed to zip.
edit: it also happens on localhost
The text was updated successfully, but these errors were encountered: