qwik icon indicating copy to clipboard operation
qwik copied to clipboard

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

Open iacore opened this issue 3 years ago • 7 comments

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).

iacore avatar Nov 06 '22 07:11 iacore

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

manucorporat avatar Nov 06 '22 12:11 manucorporat

@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

gioboa avatar Jan 06 '24 21:01 gioboa

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

iacore avatar Jan 07 '24 11:01 iacore

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

gioboa avatar Jan 07 '24 13:01 gioboa

Hi, did you solve your problem?

No.

iacore avatar Jan 07 '24 16:01 iacore

Which HTTP server are you using?

gioboa avatar Jan 07 '24 19:01 gioboa

Which HTTP server are you using?

python -m http.server

iacore avatar Jan 09 '24 14:01 iacore