hawknet icon indicating copy to clipboard operation
hawknet copied to clipboard

uri.PathAndQuery.ToLower() is not working and return "Bad mac"

Open rustbomber opened this issue 10 years ago • 1 comments

Hawk.cs:

the code in CalculateMac method, when i remove ToLower() ,and work well

var normalized = "hawk.1." + type + "\n" + ts + "\n" + nonce + "\n" + method.ToUpper() + "\n" + uri.PathAndQuery.ToLower() + "\n" + sanitizedHost.ToLower() + "\n" + uri.Port.ToString() + "\n" + ((!string.IsNullOrEmpty(payloadHash)) ? payloadHash : "") + "\n" + ((!string.IsNullOrEmpty(ext)) ? ext : "") + "\n";

rustbomber avatar Jun 27 '14 05:06 rustbomber

Yes, the ".ToLower()" statement was introduced when fixing issule https://github.com/pcibraro/hawknet/issues/24 with commit https://github.com/pcibraro/hawknet/commit/827736735fa9c4e1562021156031f627ace423c6

The issue is NOT in the current nuget version 1.4.4, apparently no new nuget package was build.

As long this issue is open, the project is not working according to the Hawk protocol, because URL's are case sensitive in the protocol.

Luke888888 avatar Sep 24 '15 15:09 Luke888888