Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sentry-ruby/lib/sentry/interfaces/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ def filter_and_format_headers(env, send_default_pii)
end
end

# Regex to detect lowercase chars — match? is allocation-free (no MatchData/String)
LOWERCASE_PATTERN = /[a-z]/.freeze

def is_skippable_header?(key)
key.upcase != key || # lower-case envs aren't real http headers
key.match?(LOWERCASE_PATTERN) || # lower-case envs aren't real http headers
key == "HTTP_COOKIE" || # Cookies don't go here, they go somewhere else
!(key.start_with?("HTTP_") || CONTENT_HEADERS.include?(key))
end
Expand Down
Loading