Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Conversation

@Techatrix
Copy link
Collaborator

The toString function on vscode.Uri will aggressively apply percent encoding even if unnecessary for some character+component cases.

This affects the + in the filename of nightly versions and the = in the query parameter. While it is valid to percent encode even if unnecessary, this can still lead to confusion about whether the url is valid if the reader is unfamiliar with the rules around percent encoding.

There is no downside to just using URL instead of vscode.Uri so that we get more readable urls. This can be especially helpful if the encoded url happens to be shown to the extension user through the error message of an exception as an example.

closes #468

I also updated source query parameter from vscode-zig to github-ziglang-vscode-zig to be similar to what mlugg/setup-zig does.

The `toString` function on `vscode.Uri` will aggressively apply percent
encoding even if unnecessary for some character+component cases.

This affects the `+` in the filename of nightly versions and the `=` in
the query parameter. While it is valid to percent encode even if
unnecessary, this can still lead to confusion about whether the url
is valid if the reader is unfamiliar with the rules around
percent encoding.

There is no downside to just using `URL` instead of `vscode.Uri` so
that we get more readable urls. This can be especially helpful if the
encoded url happens to be shown to the extension user through the
error message of an exception as an example.
@Techatrix Techatrix changed the title avoid percent encoding and source query when downloading from mirrors update source query and avoid percent encoding urls when downloading from mirrors Nov 9, 2025
@Vexu
Copy link
Member

Vexu commented Nov 9, 2025

I also updated source query parameter from vscode-zig to github-ziglang-vscode-zig to be similar to what mlugg/setup-zig does.

How about just ziglang-vscode-zig since that is the publisher in both open-vsx and Visual studio marketplace?

@dasimmet
Copy link

dasimmet commented Nov 9, 2025

I also updated source query parameter from vscode-zig to github-ziglang-vscode-zig to be similar to what mlugg/setup-zig does.

How about just ziglang-vscode-zig since that is the publisher in both open-vsx and Visual studio marketplace?

mlugg/setup-zig uses github-mlugg-setup-zig

@Techatrix
Copy link
Collaborator Author

How about just ziglang-vscode-zig since that is the publisher in both open-vsx and Visual studio marketplace?

Seems reasonable. Also has the benefit that it doesn't got out of sync if this repository is moved off github to a different provider.

@Techatrix Techatrix force-pushed the techatrix/mirror-url-encoding branch from af3fa54 to c73d4c1 Compare November 9, 2025 13:59
@Vexu Vexu merged commit c48cc94 into master Nov 9, 2025
2 checks passed
@Techatrix Techatrix deleted the techatrix/mirror-url-encoding branch November 9, 2025 19:21
@dasimmet
Copy link

@Techatrix I think there's a problem with the existing path component from community-mirrors.txt now:

zig-mirror  | info: 2025-11-17T11:14:48 - 19345us - [::1]:53292 - 404 - not_found - /zig-x86_64-linux-0.15.2.tar.xz.minisig?source=ziglang-vscode-zig
zig-mirror  | error: path: /zig-x86_64-linux-0.15.2.tar.xz.minisig?source=ziglang-vscode-zig status: .not_found 

in my case, the /zig of zig-mirror.tsimnet.eu/zig seems to be omitted, leading to a not found.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zig mirror download uris do not correctly encode query

3 participants