Skip to content
This repository
Browse code

Return an actual boolean from xml_http_request?

  • Loading branch information...
commit 6349791d5aaf652631b29f1371701fc2985fda83 1 parent ea482d3
Tim Pope tpope authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  actionpack/lib/action_dispatch/http/request.rb
2  actionpack/lib/action_dispatch/http/request.rb
@@ -154,7 +154,7 @@ def content_length
154 154 # (case-insensitive). All major JavaScript libraries send this header with
155 155 # every Ajax request.
156 156 def xml_http_request?
157   - @env['HTTP_X_REQUESTED_WITH'] =~ /XMLHttpRequest/i
  157 + /XMLHttpRequest/i === @env['HTTP_X_REQUESTED_WITH']
158 158 end
159 159 alias :xhr? :xml_http_request?
160 160

0 comments on commit 6349791

Please sign in to comment.
Something went wrong with that request. Please try again.