Skip to content

URLComponents: support http(s)+unix schemes #883

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
Aug 23, 2024

Conversation

jrflat
Copy link
Contributor

@jrflat jrflat commented Aug 21, 2024

The common (but not standardized) way to represent an "HTTP over Unix socket" URL is to use the scheme http+unix and set the URL's host to the percent-encoded path of the socket, e.g.

http+unix://%2Fvar%2Frun%2Fdocker.sock/info

Before the swift-corelibs-foundation re-core, URLComponents would always percent-encode the .host, so this worked as expected. After the re-core, URLComponents now supports and favors IDNA-encoding of the host, breaking this use case.

This PR special-cases the http+unix and https+unix schemes to percent-encode the host like before.

@jrflat
Copy link
Contributor Author

jrflat commented Aug 21, 2024

@swift-ci please test

@jrflat jrflat force-pushed the http-unix-schemes branch from 307a45d to e2f66e8 Compare August 22, 2024 18:21
@jrflat
Copy link
Contributor Author

jrflat commented Aug 22, 2024

Fixed conflicts

@jrflat
Copy link
Contributor Author

jrflat commented Aug 22, 2024

@swift-ci please test

@jrflat jrflat requested review from parkera and jmschonfeld August 23, 2024 18:27
@jrflat jrflat merged commit 3616a8b into swiftlang:main Aug 23, 2024
3 checks passed
cthielen pushed a commit to cthielen/swift-foundation that referenced this pull request Nov 8, 2024
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