Loading GitLab/API.pm +10 −5 Original line number Original line Diff line number Diff line Loading @@ -229,12 +229,17 @@ sub clean_data { croak $response->message; croak $response->message; } } # all responses from GitLab should be JSON data # no data should be present if we got 204 No Content if ($response->header("Content-Type") !~ m!^application/json!) { return $response croak "GitLab sent '", $response->header("Content-Type"), "' instead of 'application/json'"; if $response->code == HTTP_NO_CONTENT; } # otherwise we should have gotten application/json response croak "GitLab sent '", $response->header("Content-Type"), "' instead of 'application/json'" if $response->header("Content-Type") !~ m!^application/json!; return ($response, undef) unless $response->is_success; # don't process data on error return ($response, undef) unless $response->is_success; my $data = $response->decoded_content; my $data = $response->decoded_content; utf8::decode($data); utf8::decode($data); Loading Loading
GitLab/API.pm +10 −5 Original line number Original line Diff line number Diff line Loading @@ -229,12 +229,17 @@ sub clean_data { croak $response->message; croak $response->message; } } # all responses from GitLab should be JSON data # no data should be present if we got 204 No Content if ($response->header("Content-Type") !~ m!^application/json!) { return $response croak "GitLab sent '", $response->header("Content-Type"), "' instead of 'application/json'"; if $response->code == HTTP_NO_CONTENT; } # otherwise we should have gotten application/json response croak "GitLab sent '", $response->header("Content-Type"), "' instead of 'application/json'" if $response->header("Content-Type") !~ m!^application/json!; return ($response, undef) unless $response->is_success; # don't process data on error return ($response, undef) unless $response->is_success; my $data = $response->decoded_content; my $data = $response->decoded_content; utf8::decode($data); utf8::decode($data); Loading