Skip to content

Filesystem paths are not urlencoded #163

@olivia-fl

Description

@olivia-fl

Description

File paths are templated into the html verbatim. Handlebars inserts html escape characters, but this doesn't handle things like filenames containing spaces correctly.

Steps to reproduce

  1. touch 'file with spaces.txt'
  2. Execute `http-server -h 127.0.0.1 -p 8080
  3. Open http://127.0.0.1:8080
  4. Click the files with spaces.txt link
  5. The url is http://127.0.0.1:8080/files, which returns a 404

Environment

HTTP Server Version: v0.1.0
Operative System: Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions