pcibraro / hawknet

Hawk protocol implementation for .NET
MIT License
114 stars 35 forks source link

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

Open rustbomber opened 10 years ago

rustbomber commented 10 years ago

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";

Luke888888 commented 8 years ago

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.