New: CPURLConnection now has the originalRequest and currentRequest methods

Previously, CPURLConnection did not implement the originalRequest and currentRequest methods (added to Cocoa in 10.8).

This commit adds this functionality.

NB: this is dependent on CPURLRequest having deep-copy capabilities to make a copy of the original request, which has been added in another commit on this pull request.
This commit is contained in:
Andrew Hankinson committed 2014-12-04 18:08:54 -05:00
1 parent 2db9fd9657
commit c739718710
1 file changed
+3 -1
+3 -1
View File
@@ -76,7 +76,8 @@ var CPURLConnectionDelegate = nil;
*/
@implementation CPURLConnection : CPObject
{
CPURLRequest _request;
CPURLRequest _originalRequest @accessors(readonly, getter=originalRequest);
CPURLRequest _request @accessors(readonly, getter=currentRequest);
id _delegate;
BOOL _isCanceled;
BOOL _isLocalFileConnection;
@@ -151,6 +152,7 @@ var CPURLConnectionDelegate = nil;
if (self)
{
_request = aRequest;
_originalRequest = [aRequest copy];
_delegate = aDelegate;
_isCanceled = NO;