PR review changes
This commit is contained in:
parent
5e54339673
commit
4c82810d61
|
@ -78,10 +78,10 @@ return [
|
|||
'description' => 'An internal server error occurred.',
|
||||
'code' => 500,
|
||||
],
|
||||
Exception::GENERAL_METHOD_UNSUPPORTED => [
|
||||
'name' => Exception::GENERAL_METHOD_UNSUPPORTED,
|
||||
'description' => 'The HTTP method is unsupported by the current protocol or resource.',
|
||||
'code' => 405,
|
||||
Exception::GENERAL_PROTOCOL_UNSUPPORTED => [
|
||||
'name' => Exception::GENERAL_PROTOCOL_UNSUPPORTED,
|
||||
'description' => 'The request cannot be fulfilled with the current protocol. Please check the value of the _APP_OPTIONS_FORCE_HTTPS environment variable.',
|
||||
'code' => 500,
|
||||
],
|
||||
|
||||
/** User Errors */
|
||||
|
|
|
@ -174,7 +174,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $dbForCons
|
|||
if (App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS
|
||||
if ($request->getProtocol() !== 'https') {
|
||||
if($request->getMethod() !== Request::METHOD_GET) {
|
||||
throw new Exception('Method unsupported over HTTP.', 405, Exception::GENERAL_METHOD_UNSUPPORTED);
|
||||
throw new Exception('Method unsupported over HTTP.', 500, Exception::GENERAL_PROTOCOL_UNSUPPORTED);
|
||||
}
|
||||
|
||||
return $response->redirect('https://'.$request->getHostname().$request->getURI());
|
||||
|
|
|
@ -46,7 +46,7 @@ class Exception extends \Exception
|
|||
const GENERAL_ROUTE_NOT_FOUND = 'general_route_not_found';
|
||||
const GENERAL_CURSOR_NOT_FOUND = 'general_cursor_not_found';
|
||||
const GENERAL_SERVER_ERROR = 'general_server_error';
|
||||
const GENERAL_METHOD_UNSUPPORTED = 'general_method_unsupported';
|
||||
const GENERAL_PROTOCOL_UNSUPPORTED = 'general_protocol_unsupported';
|
||||
|
||||
/** Users */
|
||||
const USER_COUNT_EXCEEDED = 'user_count_exceeded';
|
||||
|
|
Loading…
Reference in a new issue