diff --git a/api/.htaccess b/api/.htaccess index 40e8812..68ad3cd 100644 --- a/api/.htaccess +++ b/api/.htaccess @@ -1,8 +1,8 @@ -# --- APIはそのまま返す --- +# --- エラーハンドリング(API) --- ErrorDocument 400 "" ErrorDocument 401 "" ErrorDocument 403 "" -ErrorDocument 404 "" +ErrorDocument 404 /errorpage/notfound.json ErrorDocument 413 "" ErrorDocument 500 "" ErrorDocument 502 "" diff --git a/api/me/settings/index.php b/api/me/settings/index.php index c4c6540..d1f79a5 100644 --- a/api/me/settings/index.php +++ b/api/me/settings/index.php @@ -84,7 +84,7 @@ if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) { // 文字数を確認 if (50 < mb_strlen($username, 'UTF-8')) { $error_message[] = 'ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT)'; - http_response_code(400); + http_response_code(413); } } diff --git a/api/users/follow.php b/api/users/follow.php index e369912..7396f10 100644 --- a/api/users/follow.php +++ b/api/users/follow.php @@ -111,7 +111,7 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { 'error_code' => $err, 'success' => false ); - http_response_code(400); + http_response_code(500); echo json_encode($response, JSON_UNESCAPED_UNICODE); } }else{ diff --git a/errorpage/notfound.json b/errorpage/notfound.json new file mode 100644 index 0000000..c577226 --- /dev/null +++ b/errorpage/notfound.json @@ -0,0 +1,4 @@ +{ + "success": false, + "error_code": "endpoint_notfound" +} diff --git a/settings_admin/maintenance_admin.php b/settings_admin/maintenance_admin.php index 9901130..334c90e 100644 --- a/settings_admin/maintenance_admin.php +++ b/settings_admin/maintenance_admin.php @@ -151,6 +151,7 @@ RewriteRule ^.*$ /errorpage/serverstop.json [R=500,L] ErrorDocument 403 /errorpage/serverstop.php RewriteCond %{REQUEST_URI} !=/function/function.php RewriteCond %{REQUEST_URI} !=/errorpage/serverstop.php +RewriteCond %{REQUEST_URI} !=/errorpage/serverstop.json RewriteCond %{REQUEST_URI} !=/css/home.css RewriteCond %{REQUEST_URI} !=/css/color.css RewriteCond %{REQUEST_URI} !=/js/console_notice.js