launcher: strip IPv6 port in check_host and avoid re-expanding placeholders in text::fill #47

Merged
ahmetbagci8 merged 1 commit from upstream-pr/47 into dev 2026-11-29 20:55:52 +00:00
ahmetbagci8 commented 2026-11-29 20:45:57 +00:00 (Migrated from github.com)

Imported from edsuuu/VI-BR-PORT. Originally posted by ahmetbagci8 on 2026-11-29T20:45:57Z.


Problem

  1. In pps/vi-launcher/src/update.rs, check_host leaves bracketed IPv6 hosts untouched (if host.starts_with('[') { host }), so a URL with a port such as http://[::1]:8080/latest.json keeps :8080 and fails to match [::1] in sources.hosts.
  2. In pps/vi-launcher/src/text.rs, ill performs sequential .replace({0}, ...), .replace({1}, ...), so if rgs[0] contains a literal {1} (for example a folder path C:\Games{1}\GTA), the next iteration overwrites it with rgs[1].

Fix

  • Parse the closing ] (and optional numeric :port) for bracketed IPv6 hosts in check_host.
  • Replace {N} placeholders in a single pass in ext::fill via ill_template.
  • Add unit tests check_host_strips_port_from_bracketed_ipv6_hosts and ill_does_not_reexpand_placeholders_inside_arguments.

Verification

  • cargo test -p vi-launcher -- update::tests::check_host_strips_port_from_bracketed_ipv6_hosts text::tests (4 passed, 0 failed)
  • cargo clippy -p vi-launcher --tests (0 warnings)
  • cargo test -p xtask english (5 passed, 0 failed)
<!-- greyfinch-sync:edsuuu/VI-BR-PORT:issue:5554939515 --> Imported from [edsuuu/VI-BR-PORT](https://github.com/edsuuu/VI-BR-PORT/pull/47). Originally posted by [ahmetbagci8](https://github.com/ahmetbagci8) on 2026-11-29T20:45:57Z. --- ## Problem 1. In pps/vi-launcher/src/update.rs, check_host leaves bracketed IPv6 hosts untouched (if host.starts_with('[') { host }), so a URL with a port such as http://[::1]:8080/latest.json keeps :8080 and fails to match [::1] in sources.hosts. 2. In pps/vi-launcher/src/text.rs, ill performs sequential .replace({0}, ...), .replace({1}, ...), so if rgs[0] contains a literal {1} (for example a folder path C:\Games\{1}\GTA), the next iteration overwrites it with rgs[1]. ## Fix - Parse the closing ] (and optional numeric :port) for bracketed IPv6 hosts in check_host. - Replace {N} placeholders in a single pass in ext::fill via ill_template. - Add unit tests check_host_strips_port_from_bracketed_ipv6_hosts and ill_does_not_reexpand_placeholders_inside_arguments. ## Verification - cargo test -p vi-launcher -- update::tests::check_host_strips_port_from_bracketed_ipv6_hosts text::tests (4 passed, 0 failed) - cargo clippy -p vi-launcher --tests (0 warnings) - cargo test -p xtask english (5 passed, 0 failed)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
edsuuu/VI-BR-PORT!47
No description provided.