Skip to content

encode_rfc3986_path_chars: incomplete character set (missing { } and backtick) #168

Description

@bug-ops

Description

encode_rfc3986_path_chars currently encodes [, ], ^, and |. RFC 3986 §2.2 also lists {, }, and backtick (`) as characters not permitted unencoded in a path segment. These are rare in practice, but omitting them produces technically non-conformant URIs.

Current behavior

let encoded_path = path
    .replace('[', "%5B")
    .replace(']', "%5D")
    .replace('^', "%5E")
    .replace('|', "%7C");
// { } ` are not encoded

Expected behavior

All RFC 3986 §2.2 "other" reserved characters ([, ], ^, |, {, }, `) are percent-encoded in the path component.

Notes

  • Risk is low: rust-analyzer, pyright, and other LSP servers use WHATWG URL parsing which is more permissive.
  • The fix is a trivial addition of three more .replace() calls (or a switch to percent-encoding via a crate).
  • Should be batched with any future cleanup of encode_rfc3986_path_chars (e.g., after the url::Position correctness fix in fix(core): encode reserved path chars in file URIs #151).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions