fix: don't bork upstream with http status code -1 (#2690)

This commit is contained in:
Dag 2022-05-08 03:57:46 +02:00 committed by GitHub
parent 641e2eedf5
commit b2f1d051fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -28,6 +28,9 @@ try {
} }
} catch(\Exception $e) { } catch(\Exception $e) {
error_log($e); error_log($e);
header('Content-Type: text/plain', true, $e->getCode()); $code = $e->getCode();
if ($code !== -1) {
header('Content-Type: text/plain', true, $code);
}
die($e->getMessage()); die($e->getMessage());
} }