Skip to content

Commit

Permalink
Merge pull request #5567 from tpope/xhr-boolean
Browse files Browse the repository at this point in the history
Return an actual boolean from xml_http_request?
  • Loading branch information
tenderlove committed Mar 24, 2012
2 parents ea482d3 + 6349791 commit beb51b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/http/request.rb
Expand Up @@ -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?

Expand Down

0 comments on commit beb51b4

Please sign in to comment.