From f118a2483a9f90e7ea4e9332b7d481aad2f01114 Mon Sep 17 00:00:00 2001 From: Willian Yaumbaev Date: Wed, 26 Aug 2020 20:31:47 +0300 Subject: [PATCH] fixed an infinite loop blocking bug --- Sources/CustomHTTPProtocol.swift | 12 +----------- Wormholy.podspec | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Sources/CustomHTTPProtocol.swift b/Sources/CustomHTTPProtocol.swift index 130631f..9e9e945 100644 --- a/Sources/CustomHTTPProtocol.swift +++ b/Sources/CustomHTTPProtocol.swift @@ -62,17 +62,7 @@ public class CustomHTTPProtocol: URLProtocol { } private func body(from request: URLRequest) -> Data? { - return request.httpBody ?? request.httpBodyStream.flatMap { stream in - let data = NSMutableData() - stream.open() - while stream.hasBytesAvailable { - var buffer = [UInt8](repeating: 0, count: 1024) - let length = stream.read(&buffer, maxLength: buffer.count) - data.append(buffer, length: length) - } - stream.close() - return data as Data - } + return request.httpBody } /// Inspects the request to see if the host has not been blacklisted and can be handled by this URL protocol. diff --git a/Wormholy.podspec b/Wormholy.podspec index 172ac9b..16920f6 100644 --- a/Wormholy.podspec +++ b/Wormholy.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Wormholy" - s.version = "1.6.2" + s.version = "1.6.3" s.summary = "Network debugging made easy" s.description = <<-DESC Start debugging iOS network calls like a wizard, without extra code! Wormholy makes debugging quick and reliable.