1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-14 14:12:31 +01:00

fix TMDB X-RateLimit-Remaining header issue

This commit is contained in:
Viktor Geringer 2019-12-19 21:34:42 +01:00 committed by GitHub
parent 30447f966f
commit 7a62ab14a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -432,8 +432,12 @@
if($response->getStatusCode() == 429) {
return false;
}
$rateLimit = $response->getHeader('X-RateLimit-Remaining');
return ((int) $response->getHeader('X-RateLimit-Remaining')[0]) > 1;
// Change it on production, good idea...
// https://www.themoviedb.org/talk/5df7d28326dac100145530f2
return $rateLimit ? (int) $rateLimit[0] > 1 : true;
}
/**