Skip to content

Commit 5ff01d8

Browse files
committed
Merge pull request #296 from alhardy/master
don't add port for urls with https scheme
2 parents 62feee0 + a41e4f2 commit 5ff01d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/Nest/Extensions/UriExtensions.cs

+3-1
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)