loicteixeira / gj-unity-api

[MOVED] Game Jolt API wrapper for Unity.
https://github.com/InfectedBytes/gj-unity-api/
MIT License
16 stars 13 forks source link

Signature is invalid for API call with trailing forward slash #59

Closed loicteixeira closed 8 years ago

loicteixeira commented 8 years ago

Issue raised by @DerpVulpes on GameJolt

It seems like GameJolt changed a little how it handles API calls as they don't allow MD5 hash being generated with an extra / character at the end. As it was reporting that the "Signature was invalid"

Example: It doesn't accept http://gamejolt.com/api/game/v1/scores/tables/?game_id=xxx&format=jsonyyyyyyyyyy it instead expect http://gamejolt.com/api/game/v1/scores/tables?game_id=xxx&format=jsonyyyyyyyyyy (notice lack of / character after the tables).

So basically a quick fix to the problem is to change Constants.cs and remove the / character in every API_XXX string except the API_ROOT so the call will not end with /.

loicteixeira commented 8 years ago

I couldn't reproduce the issue. However, it makes sense not to terminate URLs with a trailing slash.