Skip to content

fix: encode URL client-side to prevent double-slash normalization - #144

Merged
mms-gianni merged 1 commit into
everywall:release/v0.0.24from
jansonjustin:main
Jul 3, 2026
Merged

mms-gianni merged 1 commit into
everywall:release/v0.0.24from
jansonjustin:main

Conversation

@jansonjustin

Copy link
Copy Markdown

Fix: encode target URL client-side to prevent double-slash normalization

Closes #75

Problem

When a user submits a URL through the web UI, the form navigates to /<target_url> as a raw path. Browsers and reverse proxies (nginx, Traefik, Apache) normalize // in paths per RFC 3986, collapsing https:// to https:/. By the time the request reaches Ladder, the hostname is gone and it errors with http: no Host in request URL.

The existing workarounds (nginx merge_slashes off, Traefik sanitizePath: false, pinning Traefik to v3.3.5) are fragile and proxy-specific.

Fix

Encode the target URL with encodeURIComponent in the submit handler before navigation, so the browser never sees a raw :// in the path. decodeURIComponent is applied first to avoid double-encoding URLs that are already partially encoded (e.g. containing %20). A try/catch handles the edge case of malformed percent sequences.

try {
    url = encodeURIComponent(decodeURIComponent(url));
} catch (e) {
    url = encodeURIComponent(url);
}

This fix is proxy-agnostic and requires no configuration changes on the server side.

@mms-gianni
mms-gianni changed the base branch from main to release/v0.0.24 July 3, 2026 13:33
@mms-gianni
mms-gianni merged commit b1c12f5 into everywall:release/v0.0.24 Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http: no Host in request URL

2 participants