docsifyjs / docsify

๐Ÿƒ A magical documentation site generator.
https://docsify.js.org
MIT License
27.47k stars 5.67k forks source link

Error downloading file #2473

Open 757566833 opened 2 months ago

757566833 commented 2 months ago

Bug Report

Steps to reproduce

  1. docsify init ./docs
  2. make some file
  3. zip doc.zip image
  4. markdown
    
    # Headline

An awesome project.

download


5. npx docsify serve docs
6. click download
7. get http://localhost:3000/doc.zip

#### Current behaviour

<!-- Describe the current behavior here. -->

When I use an <a> tag in Markdown to download a file, clicking the link works correctly.
However, when I try to download the file directly through the URL, it doesn't work correctly.

![image](https://github.com/user-attachments/assets/fcba128e-adff-4c21-8ea0-8eb557b420c3)

![image](https://github.com/user-attachments/assets/35b7987f-29be-42f9-9042-011275eafa70)
download the file directly through the URL, the Content-Length returned by HTTP is incorrect.

#### Expected behaviour

<!-- Describe the expected behavior here. -->

#### Other relevant information

- Docsify version:

<!-- (Change "[ ]" to "[x]" to check a box.) -->

- [ ] Bug still occurs when all/other plugins are disabled?

- Docsify plugins (if the bug happens when plugins enabled, please try to isolate the issue):

<!-- Please provide the following information if relevant to the issue.

- Your OS:
- Node.js version:v20.11.0
- npm/yarn version: npm 10.2.4  / yarn 4.2.1
- Browser version: 127.0.6533.72

-->
Koooooo-7 commented 2 months ago

Hi @757566833 , thx for your report, it may similar to #1918๏ผŒ we gonna take a look on it.

cc @docsifyjs/reviewers Can reproduce on v4. Additionally: