Skip to content

Commit

Permalink
Check for headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jrothrock committed Feb 28, 2024
1 parent 94fba11 commit 6039c0c
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -4,6 +4,8 @@ class RequestQueueTimeConverter < ConverterBase

HEADERS = %w(X-Queue-Start X-Request-Start X-QUEUE-START X-REQUEST-START x-queue-start x-request-start)

WEBSOCKET_HEADERS = %w(Sec-WebSocket-Protocol Sec-WebSocket-Version Sec-WebSocket-Key)

def headers
request.headers
end
Expand All @@ -16,6 +18,7 @@ def record!
return unless headers

@context.logger.debug headers.inspect
@context.logger.debug "Request over websocket? #{request_over_websocket?}"

raw_start = locate_timestamp
return unless raw_start
Expand All @@ -40,6 +43,10 @@ def record!

private

def request_over_websocket?
WEBSOCKET_HEADERS.any? { |header| headers[header] }
end

# Looks through the possible headers with this data, and extracts the raw
# value of the header
# Returns nil if not found
Expand Down

0 comments on commit 6039c0c

Please sign in to comment.