Permalink
Browse files

Merge pull request #183 from reednj77/referer

Reflect X-XHR-Referer in request.referer - closes #169
  • Loading branch information...
2 parents 16d3c85 + 3529386 commit 6e10893115de2b015b209eff28260ad1d57705af @dhh dhh committed Feb 13, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/turbolinks.rb
View
@@ -33,6 +33,13 @@ class Engine < ::Rails::Engine
include XHRHeaders, Cookies
before_filter :set_xhr_current_location, :set_request_method_cookie
end
+
+ ActionDispatch::Request.class_eval do
+ def referer
+ self.headers['X-XHR-Referer'] || super
+ end
+ alias referrer referer
+ end
end
end
end

0 comments on commit 6e10893

Please sign in to comment.