Add a RKRequest attribute to control redirect handling

The default behavior is the same as before, to follow redirects. If RKRequest.followRedirect is set to NO, then a redirect (301, 302, 307) response will not be followed, and the request processing will proceed using the current request only.
This commit is contained in:
Marcus Brito
2012-04-04 09:20:00 -03:00
committed by Blake Watters
parent e0b248da46
commit ea100b6aac
7 changed files with 64 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ require 'restkit/network/authentication'
require 'restkit/network/etags'
require 'restkit/network/timeout'
require 'restkit/network/oauth2'
require 'restkit/network/redirection'
class Person < Struct.new(:name, :age)
def to_json(*args)
@@ -38,6 +39,7 @@ class RestKitTestServer < Sinatra::Base
use RestKit::Network::ETags
use RestKit::Network::Timeout
use RestKit::Network::OAuth2
use RestKit::Network::Redirection
def render_fixture(path, options = {})
send_file File.join(settings.public_folder, path), options