Skip to content

URL.absoluteString should always use encoded base components #1378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025

Conversation

jrflat
Copy link
Contributor

@jrflat jrflat commented Jun 24, 2025

If we aren't in the special CFURL case where we need the original absolute string, we should always leave the base components encoded. This ensures we receive properly encoded absolute strings that correctly treat ? and # as encoded path characters if those were previously inputted to the URL(filePath:) initializer.

Resolves #1367

@jrflat
Copy link
Contributor Author

jrflat commented Jun 24, 2025

@swift-ci please test

@jrflat jrflat merged commit 0c0db20 into swiftlang:main Jun 25, 2025
14 of 16 checks passed
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.

URLs created using an URL at relativeTo: which contains either ? or # return truncated URL.path
2 participants