1
0
KF2-Dev-Scripts/WebAdmin/Classes/WebConnectionEx.uc
2020-12-13 18:01:13 +03:00

32 lines
774 B
Ucode

/**
* Quick fix for handling request content type
*
* Copyright 2008 Epic Games, Inc. All Rights Reserved
*
* @author Michiel 'elmuerte' Hendriks
*/
class WebConnectionEx extends WebConnection;
function CheckRawBytes()
{
if(RawBytesExpecting <= 0)
{
if(InStr(Locs(Request.ContentType), "application/x-www-form-urlencoded") != 0)
{
`log("WebConnection: Unknown form data content-type: "$Request.ContentType);
Response.HTTPError(400); // Can't deal with this type of form data
}
else
{
Request.DecodeFormData(ReceivedData);
if (Application.PreQuery(Request, Response))
{
Application.Query(Request, Response);
Application.PostQuery(Request, Response);
}
ReceivedData = "";
}
Cleanup();
}
}