Skip to content

fix: normalize double slashes in URI building#12

Merged
juandiii merged 2 commits intomainfrom
develop
Mar 25, 2026
Merged

fix: normalize double slashes in URI building#12
juandiii merged 2 commits intomainfrom
develop

Conversation

@juandiii
Copy link
Copy Markdown
Owner

Summary

Fixes URI concatenation when baseUrl ends with / and path starts with /, causing double slashes (//) that result in 301 redirects.

Problem

// baseUrl: "https://api.ipify.org/"
// @HttpExchange("/")
// Result: https://api.ipify.org//  ← double slash → 301 Moved Permanently

Solution

Normalize duplicate slashes in AbstractClientRequest.buildUri() while preserving https://.

Tests

6 new test cases covering:

  • Trailing slash on baseUrl + leading slash on path
  • Empty path
  • Multiple consecutive slashes
  • Protocol slashes preserved

@github-actions github-actions Bot added the fix label Mar 25, 2026
@juandiii juandiii merged commit d116c9f into main Mar 25, 2026
5 checks passed
@juandiii juandiii added this to the v1.0.5 milestone Mar 25, 2026
@juandiii juandiii mentioned this pull request Mar 25, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant