Disabled invalid caching behavior for PUT & POST responses. fixes #589

This commit is contained in:
Blake Watters
2012-03-12 18:31:58 -04:00
parent f865eb9421
commit 0448090504
3 changed files with 32 additions and 14 deletions

View File

@@ -555,10 +555,7 @@ typedef void(^RKRequestDidFailLoadWithErrorBlock)(NSError *error);
/**
Returns YES if the request is cacheable
All requests are considered cacheable unless:
- The method is DELETE
- The request body is a stream (i.e. using RKParams)
Only GET requests are considered cacheable (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html).
*/
- (BOOL)isCacheable;

View File

@@ -784,12 +784,7 @@ RKRequestMethod RKRequestMethodTypeFromName(NSString *methodName) {
}
- (BOOL)isCacheable {
// DELETE is not cacheable
if (_method == RKRequestMethodDELETE) {
return NO;
}
return YES;
return _method == RKRequestMethodGET;
}
- (NSString*)cacheKey {