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:
parent
ea482d366a
commit
6349791d5a
1 changed files with 1 additions and 1 deletions
|
@ -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?
|
||||
|
||||
|
|
Loading…
Reference in a new issue