+ {
+ CFStringRef mime(CFHTTPMessageCopyHeaderFieldValue(http, CFSTR("Content-type")));
+ if (mime == NULL) {
+ [client URLProtocol:self didFailWithError:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadServerResponse userInfo:nil]];
+ goto fail;
+ }
+
+ NSURLResponse *response([[[NSURLResponse alloc] initWithURL:[request URL] MIMEType:(NSString *)mime expectedContentLength:-1 textEncodingName:nil] autorelease]);
+ CFRelease(mime);
+
+ [client URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed];
+
+ CFDataRef data(CFHTTPMessageCopyBody(http));
+ [client URLProtocol:self didLoadData:(NSData *)data];
+ CFRelease(data);
+
+ [client URLProtocolDidFinishLoading:self];
+ }