mirror of
https://codeberg.org/vlw/blobber.git
synced 2025-09-13 16:23:41 +02:00
Add Content-Type response header for error responses (#1)
Reviewed-on: https://codeberg.org/vlw/blobber/pulls/1 Co-authored-by: Victor Westerlund <victor.vesterlund@gmail.com> Co-committed-by: Victor Westerlund <victor.vesterlund@gmail.com>
This commit is contained in:
parent
84e27f66ea
commit
8d2d97f170
1 changed files with 2 additions and 0 deletions
|
@ -46,9 +46,11 @@
|
||||||
|
|
||||||
// Return HTML page if supported by client
|
// Return HTML page if supported by client
|
||||||
if ($_SERVER["HTTP_ACCEPT"] === "*/*" || strpos($_SERVER["HTTP_ACCEPT"] ?? "", "text/html") !== false) {
|
if ($_SERVER["HTTP_ACCEPT"] === "*/*" || strpos($_SERVER["HTTP_ACCEPT"] ?? "", "text/html") !== false) {
|
||||||
|
header("Content-Type: text/html", true);
|
||||||
die(sprintf(file_get_contents(__DIR__ . "/error.html"), $error->value, $error->name));
|
die(sprintf(file_get_contents(__DIR__ . "/error.html"), $error->value, $error->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header("Content-Type: text/plain", true);
|
||||||
die($error->name);
|
die($error->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue