Skip to content

Commit e9c9f51

Browse files
Merge pull request #264 from spacepluk/master
fix hardcoded HTTP version on some responses
2 parents 7ea24f9 + 4be8c78 commit e9c9f51

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

application/libraries/REST_Controller.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,7 @@ public function response($data = null, $http_code = null)
493493
}
494494
}
495495

496-
header('HTTP/1.1: ' . $http_code);
497-
header('Status: ' . $http_code);
496+
set_status_header($http_code);
498497

499498
// If zlib.output_compression is enabled it will compress the output,
500499
// but it will not modify the content-length header to compensate for
@@ -1409,8 +1408,7 @@ protected function _prepare_digest_auth()
14091408

14101409
if ($digest['response'] != $valid_response)
14111410
{
1412-
header('HTTP/1.0 401 Unauthorized');
1413-
header('HTTP/1.1 401 Unauthorized');
1411+
set_status_header(401);
14141412
exit;
14151413
}
14161414
}

0 commit comments

Comments
 (0)