bugfix: when h was nil (which it was for all my tests), everyone would fail with nil.[]= errors. Making sure we at least have a blank hash fixes this.

This commit is contained in:
Kieran Pilkington 2008-12-30 11:44:54 +13:00 committed by Josh Knowles
parent 2562942b6d
commit 0938c6dafc
1 changed files with 1 additions and 0 deletions

View File

@ -91,6 +91,7 @@ module ActionController #:nodoc:
def follow_redirect_with_headers(h = {})
raise "Not a redirect! #{@status} #{@status_message}" unless redirect?
h = Hash.new if h.nil?
h['HTTP_REFERER'] = request.url
location = headers["location"]