Permalink
Browse files

Properly handle 204 responses

  • Loading branch information...
1 parent fbdb48d commit ccf656f962556be1b3cb75905bb2cdfa3f4d51e8 @lkundrak committed Oct 11, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/WWW/GoodData/Agent.pm
@@ -147,6 +147,9 @@ sub request
# Pass processed response from subrequest (redirect)
return $response if ref $response eq 'HASH';
+ # Do not bother checking content and type if there's none
+ return undef if $response->code == 204;
+
# Decode
my $decoded = eval { decode_json ($response->content) }
if $response->header ('Content-Type') =~ /^application\/json(;.*)?/;

0 comments on commit ccf656f

Please sign in to comment.