Skip to content

Commit a41e4f2

Browse files
committed
dont add default port on uris with https scheme
1 parent 62feee0 commit a41e4f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Nest/Extensions/UriExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ public static class UriExtensions
66
{
77
public static string ToUrlAndOverridePath(this Uri uri, string path)
88
{
9-
return string.Format("http://{0}:{1}{2}", uri.Host, uri.Port, path);
9+
return uri.Scheme == Uri.UriSchemeHttps ?
10+
string.Format("https://{0}{1}", uri.Host, path) :
11+
string.Format("http://{0}:{1}{2}", uri.Host, uri.Port, path);
1012
}
1113
}
1214
}

0 commit comments

Comments
 (0)