Skip to content

Conversation

@brandonschabell
Copy link
Owner

Prevent spaces from being double encoded

Copilot AI review requested due to automatic review settings October 12, 2025 04:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a double-encoding bug where spaces encoded as %20 in URLs were being incorrectly re-encoded to %2520. The fix ensures that URL path components are properly decoded before being encoded to prevent this issue.

  • Fixed double-encoding of percent-encoded spaces by decoding path components before re-encoding
  • Added comprehensive test coverage for various positions of %20 encoding in URL paths
  • Verified that actual unencoded spaces are still properly encoded to %20

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
urlpath/init.py Modified the path property to decode parts before encoding to prevent double-encoding
tests/test_url.py Added test cases to verify the fix for percent-encoded spaces and ensure proper encoding behavior

@brandonschabell brandonschabell merged commit 78b0c52 into main Oct 12, 2025
3 checks passed
@brandonschabell brandonschabell deleted the double-encoding-bug branch October 12, 2025 04:53
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