Add temporary error reporting to debug 500 on saatavuus endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
16
api.php
16
api.php
@@ -1,4 +1,20 @@
|
||||
<?php
|
||||
// Virheraportointi (debug)
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 0);
|
||||
set_error_handler(function($errno, $errstr, $errfile, $errline) {
|
||||
http_response_code(500);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(['php_error' => $errstr, 'file' => basename($errfile), 'line' => $errline]);
|
||||
exit;
|
||||
});
|
||||
set_exception_handler(function($e) {
|
||||
http_response_code(500);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(['php_exception' => $e->getMessage(), 'file' => basename($e->getFile()), 'line' => $e->getLine()]);
|
||||
exit;
|
||||
});
|
||||
|
||||
// Turvalliset session-asetukset
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.cookie_secure', 1);
|
||||
|
||||
Reference in New Issue
Block a user