Skip to content

Commit

Permalink
Fix .NET Core host header generation if using default ports (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfspiritM authored and kannappanr committed Aug 8, 2018
1 parent 754550c commit dd946d4
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions Minio/V4Authenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,30 +414,10 @@ private SortedDictionary<string, string> GetHeadersToSign(IRestRequest request)
{
string headerName = header.Name.ToLower();
string headerValue = header.Value.ToString();
#if NET46
if (!ignoredHeaders.Contains(headerName))
{
sortedHeaders.Add(headerName, headerValue);
}
#else
if (headerName.Equals("host"))
{
var host = headerValue.Split(':')[0];
var port = headerValue.Split(':')[1];
if (port.Equals("80") || port.Equals("443"))
{
sortedHeaders.Add(headerName, host);
}
else
{
sortedHeaders.Add(headerName, headerValue);
}
}
else if (!ignoredHeaders.Contains(headerName))
{
sortedHeaders.Add(headerName, headerValue);
}
#endif
}

return sortedHeaders;
Expand Down

0 comments on commit dd946d4

Please sign in to comment.