diff options
Diffstat (limited to 'static/classes')
| -rwxr-xr-x | static/classes/Response.class.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/static/classes/Response.class.php b/static/classes/Response.class.php index 4e28678..3518133 100755 --- a/static/classes/Response.class.php +++ b/static/classes/Response.class.php @@ -43,15 +43,16 @@ class Response $this->type = $response_type; break; case 'gyazo': - // Deprecated API since version 2.0.0 + // Deprecated API since version 2.0.0, use text response instead // fallthrough case 'text': header('Content-Type: text/plain; charset=UTF-8'); $this->type = $response_type; break; default: - http_response_code(400); - echo 'Invalid response type. Valid options are: csv, html, json, text.'; + header('Content-Type: application/json; charset=UTF-8'); + $this->type = 'json'; + $this->error(400, 'Invalid response type. Valid options are: csv, html, json, text.'); break; } } @@ -70,6 +71,9 @@ class Response case 'json': $response = $this->json_error($code, $desc); break; + case 'gyazo': + // Deprecated API since version 2.0.0, use text response instead + // fallthrough case 'text': $response = $this->text_error($code, $desc); break; @@ -93,6 +97,9 @@ class Response case 'json': $response = $this->json_success($files); break; + case 'gyazo': + // Deprecated API since version 2.0.0, use text response instead + // fallthrough case 'text': $response = $this->text_success($files); break; |
