Source

NSURLConnectionVCR / NSURLConnectionVCR / NSURLConnectionVCR.m

Diff from to

NSURLConnectionVCR/NSURLConnectionVCR.m

 - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
     if (responseData == nil) {
         long long expectedContentLength = [response expectedContentLength];
-        responseData = [NSMutableData dataWithCapacity:expectedContentLength];
+        if (expectedContentLength > 0) {
+            responseData = [NSMutableData dataWithCapacity:expectedContentLength];
+        } else {
+            responseData = [NSMutableData data];
+        }
     }
     [responseData appendData:data];
     [realDelegate connection:connection didReceiveData:data];