diff --git a/VOKMockUrlProtocol.m b/VOKMockUrlProtocol.m index 590042a..3cb7aa3 100644 --- a/VOKMockUrlProtocol.m +++ b/VOKMockUrlProtocol.m @@ -117,11 +117,11 @@ - (NSArray *)resourceNames NSString *contentType = [self.request valueForHTTPHeaderField:HTTPHeaderContentType]; NSString *bodyString; - if ([HTTPHeaderContentTypeFormUrlencoded isEqualToString:contentType]) { + if ([contentType hasPrefix:HTTPHeaderContentTypeFormUrlencoded]) { // If it's form-URL-encoded, generate a resource name by appending the body as a string. bodyString = [[NSString alloc] initWithData:bodyData encoding:NSUTF8StringEncoding]; - } else if ([HTTPHeaderContentTypeJson isEqualToString:contentType]) { + } else if ([contentType hasPrefix:HTTPHeaderContentTypeJson]) { // Otherwise, if it's JSON, generate a resource name by bencoding the JSON datastructure and // percent-escaping the resulting string. NSData *bencoded = [VOKBenkode encode: diff --git a/VOKMockUrlProtocol.podspec b/VOKMockUrlProtocol.podspec index 800f797..6e81543 100644 --- a/VOKMockUrlProtocol.podspec +++ b/VOKMockUrlProtocol.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "VOKMockUrlProtocol" - s.version = "2.0.2" + s.version = "2.0.3" s.summary = "A url protocol that parses and returns fake responses with mock data." s.homepage = "https://github.com/vokal/VOKMockUrlProtocol" s.license = { :type => "MIT", :file => "LICENSE"}