Skip to content

Fix leading slash for abspath in joinpath (continuation of #62) - #71

Merged
quinnj merged 4 commits into
masterfrom
bug/joinpath
Aug 9, 2026
Merged

Fix leading slash for abspath in joinpath (continuation of #62)#71
quinnj merged 4 commits into
masterfrom
bug/joinpath

Conversation

@quinnj

@quinnj quinnj commented Aug 9, 2026

Copy link
Copy Markdown
Member

Continuation of #62 by @pb866 (the head branch there lives in an org-owned fork, which GitHub doesn't allow maintainer pushes to, so finishing it here — original commits/authorship preserved).

On top of #62's fix for the double leading slash (joinpath(URI("http://test.com"), "/abs/path") now correctly gives http://test.com/abs/path), this:

  • Merges current master into the branch
  • Resolves the remaining review point from Fix leading slash for abspath in joinpath #62: when the base URI has no authority component (e.g. URI("file:") or an empty URI()), a joined path beginning with // is unrepresentable per RFC 3986 §3.3 — serializing it would be re-parsed with the first path segment as the authority, breaking round-tripping. joinpath now throws an informative ArgumentError in that case.
  • Adds regression tests for file:, file://, empty-URI, and authority-present cases, including string round-trip checks. Note file:// (empty-but-present authority) serializes as file:////server/share, which round-trips fine and remains allowed.
  • Bumps the version to 1.6.3

Merging this will mark #62 as merged automatically (its head commit is in this branch's history).

🤖 Generated with Claude Code

pb866 and others added 4 commits December 28, 2024 22:56
Signed-off-by: Peter Bräuer <pb866.git@gmail.com>
Add tests to add absolut path with and without trailing slash and
absolut path with additional part to an empty uri path.

Signed-off-by: Peter Bräuer <pb866.git@gmail.com>
Per RFC 3986 Section 3.3, a URI without an authority component cannot
have a path beginning with "//" -- serializing such a URI is ambiguous
(the path prefix would be re-parsed as an authority), breaking
string/parse round-tripping. Throw an informative ArgumentError from
joinpath in that case, and add regression tests covering "file:",
"file://", empty-URI, and authority-present cases.

Bump version to 1.6.3.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.63%. Comparing base (bbab448) to head (1a35370).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
+ Coverage   84.49%   84.63%   +0.14%     
==========================================
  Files           5        5              
  Lines         329      332       +3     
==========================================
+ Hits          278      281       +3     
  Misses         51       51              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@quinnj
quinnj merged commit 0f4ecc3 into master Aug 9, 2026
11 checks passed
@quinnj
quinnj deleted the bug/joinpath branch August 9, 2026 20:48
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.

2 participants