Skip to content

webdav: use URLPathEscapeAll for RFC 3986 compliant path encoding#9180

Open
veeceey wants to merge 1 commit intorclone:masterfrom
veeceey:fix/issue-9082-webdav-semicolon-escape
Open

webdav: use URLPathEscapeAll for RFC 3986 compliant path encoding#9180
veeceey wants to merge 1 commit intorclone:masterfrom
veeceey:fix/issue-9082-webdav-semicolon-escape

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 14, 2026

Fixes #9082

The WebDAV backend uses URLPathEscape for path encoding, which relies on Go's url.URL.String(). This only does minimal escaping and lets reserved sub-delimiter characters like semicolons (;) and equals signs (=) through unescaped.

Per RFC 3986 section 3.3, these characters must be percent-encoded when used as literal path values. Some WebDAV servers (dCache running on Jetty in the reporter's case) interpret unescaped semicolons as path parameter delimiters per the RFC, which silently truncates the filename at the semicolon position.

Switched to URLPathEscapeAll which encodes everything except [A-Za-z0-9/]. As @ncw mentioned in the issue, the extra encoding overhead is negligible compared to data transfer and round trips.

Added a test that spins up a mock WebDAV server and verifies semicolons in filenames are percent-encoded in the request path.

Use URLPathEscapeAll instead of URLPathEscape for path encoding.

URLPathEscape relies on Go's url.URL.String() which only minimally
escapes paths - reserved sub-delimiter characters like semicolons and
equals signs pass through unescaped. Per RFC 3986 section 3.3, these
characters must be percent-encoded when used as literal values in
path segments.

Some WebDAV servers (notably dCache/Jetty) interpret unescaped
semicolons as path parameter delimiters, which truncates filenames
at the semicolon position. URLPathEscapeAll encodes everything
except [A-Za-z0-9/], which is safe for all servers.

Fixes rclone#9082
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.

rclone sends unescaped semicolons to WebDAV endpoints

1 participant