lib/sensu/api/http_handler.rb
def request_details
        return @request_details if @request_details
        @request_id = @http.fetch(:x_request_id, random_uuid)
        @request_start_time = Time.now.to_f
        _, remote_address = Socket.unpack_sockaddr_in(get_peername)
        @request_details = {
          :request_id => @request_id,
          :remote_address => remote_address,
          :user_agent => @http[:user_agent],
          :method => @http_request_method,
          :uri => @http_request_uri,
          :query_string => @http_query_string,
          :body => @http_content
        }
        if @http[:x_forwarded_for]
          @request_details[:x_forwarded_for] = @http[:x_forwarded_for]
        end
        @request_details
      end
# Create a hash containing the HTTP request details. This method
# determines the remote address for the HTTP client (using
# EventMachine Connection `get_peername()`).
#
# @result [Hash]
Create a hash containing the HTTP request details. This method
determines the remote address for the HTTP client (using
EventMachine Connection `get_peername()`).
Create a hash containing the HTTP request details . This method determines the remote address for the HTTP client ( using EventMachine Connection ` get_peername () ` ) .
def request_details
        return @request_details if @request_details
        @request_id = @http.fetch(:x_request_id, random_uuid)
        @request_start_time = Time.now.to_f
        _, remote_address = Socket.unpack_sockaddr_in(get_peername)
        @request_details = {
          :request_id => @request_id,
          :remote_address => remote_address,
          :user_agent => @http[:user_agent],
          :method => @http_request_method,
          :uri => @http_request_uri,
          :query_string => @http_query_string,
          :body => @http_content
        }
        if @http[:x_forwarded_for]
          @request_details[:x_forwarded_for] = @http[:x_forwarded_for]
        end
        @request_details
      end
def request_details return @request_details if @request_details @request_id = @http . fetch ( :x_request_id , random_uuid ) @request_start_time = Time . now . to_f _ , remote_address = Socket . unpack_sockaddr_in ( get_peername ) @request_details = { :request_id => @request_id , :remote_address => remote_address , :user_agent => @http [ :user_agent ] , :method => @http_request_method , :uri => @http_request_uri , :query_string => @http_query_string , :body => @http_content } if @http [ :x_forwarded_for ] @request_details [ :x_forwarded_for ] = @http [ :x_forwarded_for ] end @request_details end
Create a hash containing the HTTP request details.
Create a hash containing the HTTP request details .
result
None