Skip to content

Commit

Permalink
Merge branch '3.2.x' into 3.3.x
Browse files Browse the repository at this point in the history
Closes gh-41234
  • Loading branch information
philwebb committed Jun 25, 2024
2 parents 6d0c68f + 85f6641 commit eb9f16e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public String resolveCanonicalHostname(String host) throws UnknownHostException
*/
private static class LocalConnectionSocketFactory implements ConnectionSocketFactory {

private static final String NPIPE_PREFIX = "npipe://";

private final String host;

LocalConnectionSocketFactory(String host) {
Expand All @@ -124,10 +126,10 @@ private static class LocalConnectionSocketFactory implements ConnectionSocketFac

@Override
public Socket createSocket(HttpContext context) throws IOException {
if (Platform.isWindows()) {
return NamedPipeSocket.get(this.host);
if (this.host.startsWith(NPIPE_PREFIX)) {
return NamedPipeSocket.get(this.host.substring(NPIPE_PREFIX.length()));
}
return DomainSocket.get(this.host);
return (!Platform.isWindows()) ? DomainSocket.get(this.host) : NamedPipeSocket.get(this.host);
}

@Override
Expand Down

0 comments on commit eb9f16e

Please sign in to comment.