mirror of
https://github.com/mm201/GamestatsBase.git
synced 2026-09-08 18:45:11 -05:00
Allow skipping the token check if request is a POST. (needed for Animal Crossing)
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user