summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/presque/Role/Response.pm21
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/presque/Role/Response.pm b/lib/presque/Role/Response.pm
index 8f9aa76..a3944f3 100644
--- a/lib/presque/Role/Response.pm
+++ b/lib/presque/Role/Response.pm
@@ -2,27 +2,10 @@ package presque::Role::Response;
use Moose::Role;
-before get => sub {
- (shift)->_set_response_content_type;
+before finish => sub {
+ (shift)->response->header('Content-Type' => 'application/json');
};
-before put => sub {
- (shift)->_set_response_content_type;
-};
-
-before post => sub {
- (shift)->_set_response_content_type;
-};
-
-before delete => sub {
- (shift)->_set_response_content_type;
-};
-
-sub _set_response_content_type {
- my $self = shift;
- $self->response->header('Content-Type' => 'application/json');
-}
-
sub entity {
my ($self, $content) = @_;
$self->finish(JSON::encode_json($content));