summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorJuuso Lapinlampi <wub@partyvan.eu>2016-01-06 14:23:26 +0100
committerJuuso Lapinlampi <wub@partyvan.eu>2016-01-06 14:39:25 +0100
commitb94ac9a9bc957623687bf3cd21548569b96d4a01 (patch)
tree91ca1ea7e6b135fb130855cf2a2b06965704f744 /static
parent73fbb9741df30e3a3a6b93bc7d07cd776643ccdd (diff)
Fix gyazo response fallthrough to text response
The gyazo response would return an empty response, because the construct didn't actually fallthrough to text properly. Force gyazo's response type to be 'text' to fix the issue. Accordingly, the 'gyazo' cases for send() and error() now become dead code. Remove them. OK ewhal@
Diffstat (limited to 'static')
-rwxr-xr-xstatic/classes/Response.class.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/static/classes/Response.class.php b/static/classes/Response.class.php
index 3518133..81e7fb4 100755
--- a/static/classes/Response.class.php
+++ b/static/classes/Response.class.php
@@ -43,8 +43,10 @@ class Response
$this->type = $response_type;
break;
case 'gyazo':
- // Deprecated API since version 2.0.0, use text response instead
- // fallthrough
+ // Deprecated API since version 2.0.0, fallback to similar text API
+ header('Content-Type: text/plain; charset=UTF-8');
+ $this->type = 'text';
+ break;
case 'text':
header('Content-Type: text/plain; charset=UTF-8');
$this->type = $response_type;
@@ -71,9 +73,6 @@ 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;
@@ -97,9 +96,6 @@ 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;