bedder feedback on http response

This commit is contained in:
2021-03-23 13:39:44 +01:00
parent e08a0df52f
commit 0419ecf707
17 changed files with 132 additions and 90 deletions
@@ -15,14 +15,14 @@ function ZipFileHandler(string $gameFileName, string $gameFileTmp){
if(in_array($headerType,$headerTypeMatch)){
$gameFileNewName = uniqid("", true). "." . $fileActualExtGame;
if(empty($gameFileName)){
echo http_response_code(400);
http_response_code(400);
exit();
}
rename($gameFileTmp,"../../Games/".$gameFileNewName);
return $gameFileNewName;
}else{
echo "Wrong file type";
echo http_response_code(400);
http_response_code(400);
echo json_encode(["message" => "Wrong file type gameFile"]);
exit();
}
return NULL;
@@ -43,14 +43,14 @@ function imagesFileHandler(string $thumbnailFileName, string $thumbnailFileTmp){
if(in_array($headerType,$headerTypeMatch)){
$thumbnailFileNewName = uniqid("", true). "." . $fileActualExtThumb;
if(empty($thumbnailFileName)){
echo http_response_code(400);
http_response_code(400);
exit();
}
rename($thumbnailFileTmp,"../../../Frontend/images/".$thumbnailFileNewName);
return $thumbnailFileNewName;
}else{
echo "Wrong file type";
echo http_response_code(400);
http_response_code(400);
echo json_encode(["message" => "Wrong file type thumbnailFile"]);
exit();
}
return NULL;