Permalink
Browse files

Return an actual boolean from xml_http_request?

  • Loading branch information...
1 parent ea482d3 commit 6349791d5aaf652631b29f1371701fc2985fda83 @tpope tpope committed Mar 24, 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 6349791

Please sign in to comment.