git.cweiske.de
/
stouyapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Let OUYAs fetch firmware info only once a day, remove the redirect for gamers/me
[stouyapi.git]
/
www
/
api
/
v1
/
queued_downloads_delete.php
diff --git
a/www/api/v1/queued_downloads_delete.php
b/www/api/v1/queued_downloads_delete.php
index 3861f93f060187d5bd563082aea65c64cabacd7c..6517adca2be082884f758a4f6585218d09961216 100644
(file)
--- a/
www/api/v1/queued_downloads_delete.php
+++ b/
www/api/v1/queued_downloads_delete.php
@@
-12,15
+12,16
@@
$apiGameDir = __DIR__ . '/details-data/';
require_once __DIR__ . '/../../../src/push-to-my-ouya-helpers.php';
$ip = $_SERVER['REMOTE_ADDR'];
require_once __DIR__ . '/../../../src/push-to-my-ouya-helpers.php';
$ip = $_SERVER['REMOTE_ADDR'];
-if ($ip == '' || strpos($ip, ':') !== false) {
- //empty or IPv6
+if ($ip == '') {
+ //empty ip
+ header('X-Fail-Reason: empty ip address');
header('HTTP/1.0 204 No Content');
exit(1);
}
$ip = mapIp($ip);
$game = $_GET['game'];
header('HTTP/1.0 204 No Content');
exit(1);
}
$ip = mapIp($ip);
$game = $_GET['game'];
-$cleanGame = preg_replace('#[^a-zA-Z0-9.]#', '', $game);
+$cleanGame = preg_replace('#[^a-zA-Z0-9.
_
]#', '', $game);
if ($game != $cleanGame || $game == '') {
header('HTTP/1.0 400 Bad Request');
header('Content-type: text/plain');
if ($game != $cleanGame || $game == '') {
header('HTTP/1.0 400 Bad Request');
header('Content-type: text/plain');
@@
-32,6
+33,7
@@
try {
$db = new SQLite3($dbFile, SQLITE3_OPEN_READWRITE);
} catch (Exception $e) {
//db file not found
$db = new SQLite3($dbFile, SQLITE3_OPEN_READWRITE);
} catch (Exception $e) {
//db file not found
+ header('X-Fail-Reason: database file not found');
header('HTTP/1.0 204 No Content');
exit(1);
}
header('HTTP/1.0 204 No Content');
exit(1);
}