Skip to content

Escape characters not allowed by URL specs but not escaped by URL::toString #10307

@JoHaHu

Description

@JoHaHu

Describe the bug

Whe using vite in dev mode behind a proxy illegal characters in URL can lead to errors.
As an example Nuxt 3 uses [foo] as pattern for dynamic routes. During development url for modules aren't properly url-encoded.

Reproduction:
open stackblitz example and navigate to /test/id. In the browser network trace there is a request for /test/[id].vue which fails when used behind certain proxies.

nuxt/nuxt#15049

Reproduction

https://stackblitz.com/edit/github-tjxq2a-k3p4ab

System Info

System:
    OS: Linux 5.19 Fedora Linux 36 (Workstation Edition)
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 21.48 GB / 31.04 GB
    Container: Yes
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
  Browsers:
    Firefox: 105.0.1

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions