1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Return an actual boolean from xml_http_request?

This commit is contained in:
Tim Pope 2012-03-23 20:19:38 -04:00
parent ea482d366a
commit 6349791d5a

View file

@ -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?