Skip to content

Fix URI.merge leaking :+ marker when base path is empty string#15179

Merged
josevalim merged 1 commit intoelixir-lang:mainfrom
pnezis:fix-uri-merge-empty-path
Mar 11, 2026
Merged

Fix URI.merge leaking :+ marker when base path is empty string#15179
josevalim merged 1 commit intoelixir-lang:mainfrom
pnezis:fix-uri-merge-empty-path

Conversation

@pnezis
Copy link
Copy Markdown
Contributor

@pnezis pnezis commented Mar 11, 2026

When merging URIs where the base has path: "", the internal :+ marker used to track the join point between base and relative paths was being converted to a literal "+" in the output.

iex(1)> base = %URI{scheme: "http", host: "example.com", path: ""}
iex(2)> URI.merge(base, "foo") |> to_string()
"http://example.com/+/foo"

When merging URIs where the base has `path: ""`, the internal `:+` marker
used to track the join point between base and relative paths was being
converted to a literal "+" in the output.
@josevalim josevalim closed this Mar 11, 2026
@josevalim josevalim reopened this Mar 11, 2026
@josevalim josevalim merged commit ababaf8 into elixir-lang:main Mar 11, 2026
20 of 28 checks passed
@josevalim
Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

@pnezis pnezis deleted the fix-uri-merge-empty-path branch March 11, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants