Skip to content

Commit 6186e83

Browse files
committed
Server error/hint pages with a 500 error code to avoid it being seen instead of the actual resource
* found while reviewing #7205 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
1 parent f148e3f commit 6186e83

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/private/legacy/template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ public static function printErrorPage( $error_msg, $hint = '' ) {
317317
$hint = '';
318318
}
319319

320+
header(self::getHttpProtocol() . ' 500 Internal Server Error');
320321
try {
321322
$content = new \OC_Template( '', 'error', 'error', false );
322323
$errors = array(array('error' => $error_msg, 'hint' => $hint));
@@ -327,7 +328,6 @@ public static function printErrorPage( $error_msg, $hint = '' ) {
327328
$logger->error("$error_msg $hint", ['app' => 'core']);
328329
$logger->logException($e, ['app' => 'core']);
329330

330-
header(self::getHttpProtocol() . ' 500 Internal Server Error');
331331
header('Content-Type: text/plain; charset=utf-8');
332332
print("$error_msg $hint");
333333
}

0 commit comments

Comments
 (0)