QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.64k stars 1.28k forks source link

Qwik City SSG - can't have special characters in dynamic route URI #1999

Open iacore opened 1 year ago

iacore commented 1 year ago

Qwik Version

    "@builder.io/qwik": "^0.12.1",
    "@builder.io/qwik-city": "^0.0.112",

Which component is affected?

Qwik City

Expected Behaviour

When generating route like /[abc], when abc has space (0x20) in it, it should retain the space character.

For example, if the URI is /a%20b, the generated file should be at /dist/a b/index.html

Actual Behaviour

If the URI is /a%20b, the generated file is at /dist/a%20b/index.html

A lot of HTTP server expect the file name not to be encoded.

Additional Information

This feature is useful for supporting non-ascii characters in the URL, like /一二 (invalid URI, but Firefox would display it as such).

manucorporat commented 1 year ago

This makes sense! wanna give it a try trying to fix this issue? hopefully it's a simple fix

gioboa commented 8 months ago

@iacore Hi, did you solve your problem? I looked into the code and there is a specific test that verify the space case. https://github.com/BuilderIO/qwik/blob/341038bb419ffd0969cd48aa6cf303217bedacf7/packages/qwik-city/utils/pathname.unit.ts#L56

iacore commented 8 months ago

https://github.com/BuilderIO/qwik/blob/341038bb419ffd0969cd48aa6cf303217bedacf7/packages/qwik-city/utils/pathname.unit.ts#L59

gioboa commented 8 months ago

Yep, so how did you solve the issue? Which workaround did you use?

iacore commented 8 months ago

Hi, did you solve your problem?

No.

gioboa commented 8 months ago

Which HTTP server are you using?

iacore commented 8 months ago

Which HTTP server are you using?

python -m http.server