Allow skipping the token check if request is a POST. (needed for Animal Crossing)

This commit is contained in:
Greg Edwards
2014-09-12 18:38:56 -04:00
parent 429b296a96
commit 63a13037bb

View File

@@ -121,22 +121,26 @@ namespace GamestatsBase
return;
}
GamestatsSession session = null;
GamestatsSessionManager manager = GamestatsSessionManager.FromContext(context);
if (!manager.Sessions.ContainsKey(form["hash"]))
if (manager.Sessions.ContainsKey(form["hash"]))
{
session = manager.Sessions[form["hash"]];
if (session.GameId != GameId)
{
// matched wrong game. Highly unlikely
ShowError(context, 400);
return;
}
}
else if (context.Request.HttpMethod == "GET")
{
// session hash not matched
ShowError(context, 400);
return;
}
GamestatsSession session = manager.Sessions[form["hash"]];
if (session.GameId != GameId)
{
// matched wrong game. Highly unlikely
ShowError(context, 400);
return;
}
byte[] data;
try
{