Browse files

Merge pull request #5567 from tpope/xhr-boolean

Return an actual boolean from xml_http_request?
  • Loading branch information...
2 parents ea482d3 + 6349791 commit beb51b4d5f73abc5be6a82a9d63d3cce6de5a9a2 @tenderlove tenderlove committed Mar 23, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/http/request.rb
View
2 actionpack/lib/action_dispatch/http/request.rb
@@ -154,7 +154,7 @@ def content_length
# (case-insensitive). All major JavaScript libraries send this header with
# every Ajax request.
def xml_http_request?
- @env['HTTP_X_REQUESTED_WITH'] =~ /XMLHttpRequest/i
+ /XMLHttpRequest/i === @env['HTTP_X_REQUESTED_WITH']
end
alias :xhr? :xml_http_request?

0 comments on commit beb51b4

Please sign in to comment.