提交 39837b17 编写于 作者: A Aaron Patterson

metaprogram the HTTP_X_REQUEST_ID method

we're already doing this with a bunch of other header data.
上级 64f6dc6d
......@@ -20,8 +20,6 @@ class Request < Rack::Request
include ActionDispatch::Http::FilterParameters
include ActionDispatch::Http::URL
HTTP_X_REQUEST_ID = "HTTP_X_REQUEST_ID".freeze # :nodoc:
autoload :Session, 'action_dispatch/request/session'
autoload :Utils, 'action_dispatch/request/utils'
......@@ -36,6 +34,7 @@ class Request < Rack::Request
HTTP_ACCEPT_LANGUAGE HTTP_CACHE_CONTROL HTTP_FROM
HTTP_NEGOTIATE HTTP_PRAGMA HTTP_CLIENT_IP
HTTP_X_FORWARDED_FOR HTTP_VERSION
HTTP_X_REQUEST_ID
].freeze
ENV_METHODS.each do |env|
......@@ -269,10 +268,6 @@ def request_id=(id) # :nodoc:
alias_method :uuid, :request_id
def x_request_id # :nodoc:
get_header(HTTP_X_REQUEST_ID)
end
# Returns the lowercase name of the HTTP server software.
def server_software
(get_header('SERVER_SOFTWARE') && /^([a-zA-Z]+)/ =~ get_header('SERVER_SOFTWARE')) ? $1.downcase : nil
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册