hawknet
hawknet copied to clipboard
uri.PathAndQuery.ToLower() is not working and return "Bad mac"
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";
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.