lib/yard/server/rack_adapter.rb in yard-0.9.5 vs lib/yard/server/rack_adapter.rb in yard-0.9.6
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
require 'rack'
require 'webrick/httputils'
module YARD
module Server
@@ -82,7 +83,7 @@
# @private
class Rack::Request
attr_accessor :version_supplied
alias query params
- def xhr?; (env['HTTP_X_REQUESTED_WITH'] || "").downcase == "xmlhttprequest" end
+ def xhr?; (env['HTTP_X_REQUESTED_WITH'] || "").casecmp("xmlhttprequest") == 0 end
end