Skip to content

Commit c6e55de

Browse files
committed
Code optimization
1 parent d417718 commit c6e55de

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

www/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function main(array $query): void {
88
if (empty($query["file"])) throw new LogicException("Bad Request", 400);
99
$output = php_strip_whitespace($query["file"]);
1010
if (!$output) throw new RuntimeException("Not Found", 404);
11-
sendResponse($output, "application/x-php");
11+
sendResponse($output, "text/x-php; charset=utf-8");
1212
}
1313

1414
/**
@@ -31,5 +31,5 @@ function sendResponse(string $body, string $mediaType = "application/octet-strea
3131
}
3232
catch (Throwable $e) {
3333
$code = $e->getCode();
34-
sendResponse($e->getMessage(), "text/plain", $code >= 400 && $code < 600 ? $code : 500);
34+
sendResponse($e->getMessage(), "text/plain; charset=utf-8", $code >= 400 && $code < 600 ? $code : 500);
3535
}

0 commit comments

Comments
 (0)