diff options
author | Tim Pope <code@tpope.net> | 2012-03-23 20:19:38 -0400 |
---|---|---|
committer | Tim Pope <code@tpope.net> | 2012-03-23 20:19:38 -0400 |
commit | 6349791d5aaf652631b29f1371701fc2985fda83 (patch) | |
tree | 8b7c8e8c54c845dc489f72abad861ee972f00520 | |
parent | ea482d366addd86ea3a5255e6e764733b9a17fa8 (diff) | |
download | rails-6349791d5aaf652631b29f1371701fc2985fda83.tar.gz rails-6349791d5aaf652631b29f1371701fc2985fda83.tar.bz2 rails-6349791d5aaf652631b29f1371701fc2985fda83.zip |
Return an actual boolean from xml_http_request?
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 796e0dbc45..4ac13695bf 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -154,7 +154,7 @@ module ActionDispatch # (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? |