Skip to content

Commit

Permalink
Fix an Accept header bug; relates to #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Khabibullin committed May 31, 2015
1 parent bb4a8f9 commit 076a6a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Raisin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ sub psgi {
}

my $type = $req->accept_format;
if ( ($req->header('Accept') && !$type)
my $accept = $req->header('Accept')
&& $req->header('Accept') eq '*/*' ? undef : $req->header('Accept');
if ( ($accept && !$type)
|| (($self->api_format && $type) && ($self->api_format ne $type)))
{
$self->log(error => 'Content-type provided not acceptable');
Expand Down

0 comments on commit 076a6a6

Please sign in to comment.