Переглянути джерело

Fix #117: limit network response size

Limit cached network response size to 50 MB
Tanner Bennett 8 роки тому
батько
коміт
8b7c59d949
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      Classes/Network/PonyDebugger/FLEXNetworkObserver.m

+ 1 - 1
Classes/Network/PonyDebugger/FLEXNetworkObserver.m

@@ -944,7 +944,7 @@ static char const * const kFLEXRequestIDKey = "kFLEXRequestIDKey";
         NSMutableData *dataAccumulator = nil;
         NSMutableData *dataAccumulator = nil;
         if (response.expectedContentLength < 0) {
         if (response.expectedContentLength < 0) {
             dataAccumulator = [[NSMutableData alloc] init];
             dataAccumulator = [[NSMutableData alloc] init];
-        } else {
+        } else if (response.expectedContentLength < 52428800) {
             dataAccumulator = [[NSMutableData alloc] initWithCapacity:(NSUInteger)response.expectedContentLength];
             dataAccumulator = [[NSMutableData alloc] initWithCapacity:(NSUInteger)response.expectedContentLength];
         }
         }
         requestState.dataAccumulator = dataAccumulator;
         requestState.dataAccumulator = dataAccumulator;