Skip to content

Served file not exactly the same when downloaded certain files running local server #1694

Open
@igonro

Description

@igonro

Bug Report

Steps to reproduce

This is my case:

  1. Create an encrypted file. I use EncryptPad for this with the first Lorem Ipsum paragraph in it.
  2. Add it to your docsify project (I add it in /static/files/lorem-ipsum.epd)
  3. Add a link to that file in a markdown file (I do this with [test](/static/files/lorem-ipsum.epd ':ignore')
  4. Run the local server with docsify serve .

What is current behaviour

The original file in /static/files/lorem-ipsum.epd and the downloaded file (when clicked in the link) are not the same. In my case the original has 340 bytes and the downloaded one has 628 bytes.

The big problem is that now I can't decrypt the file anymore.

What is the expected behaviour

The expected behaviour is that both files (original one and downloaded one) should be exactly the same.

In order to test if this was a bug or not I tried a few things:

  1. Serve with python -m http.server instead of docsify serve .: it loaded the docs correctly, and the downloaded file was exactly the same as the original.
  2. Manually creating a html file with the code generated by docsify <a href="/static/files/lorem-ipsum.epd" target="_blank" rel="noopener">test</a> and opening it directly with the browser: it downloads the file properly.
  3. Running with server for SSR docsify start .: it downloads the file properly.

So based on this, I think that the expected behaviour should be to download the file properly when running a local server. Maybe someone can tell me why this happens and that it's not a bug. I will appreciate any response.

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: WSL2 (Ubuntu)

  • Node.js version: 17.2.0

  • npm/yarn version: npm 8.1.4

  • Browser version: Firefox 95.0.1; Chrome 96.0.4664.110.

  • Docsify version: 4.4.3

  • Docsify plugins: None.

Please create a reproducible sandbox

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions