Skip to content

Commit

Permalink
Expanded documentation for unwrap_headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Nov 14, 2024
1 parent cd6d4ec commit 90f0baf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/protocol/rack/adapter/generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,17 @@ def logger
Console
end

# Unwrap raw HTTP headers into the CGI-style expected by Rack middleware.
# Unwrap HTTP headers into the CGI-style expected by Rack middleware, and add them to the rack `env`.
#
# Rack separates multiple headers with the same key, into a single field with multiple lines.
# e.g. `accept-encoding` becomes `HTTP_ACCEPT_ENCODING`.
#
# Headers keys with underscores will generate the same CGI-style header key as headers with dashes.
#
# e.g `accept_encoding` becomes `HTTP_ACCEPT_ENCODING` too.
#
# You should not implicitly trust the `HTTP_` headers for security purposes, as they are generated by the client.
#
# Multiple headers are combined with a comma, with one exception: `HTTP_COOKIE` headers are combined with a semicolon.
#
# @parameter headers [Protocol::HTTP::Headers] The raw HTTP request headers.
# @parameter env [Hash] The rack request `env`.
Expand Down

0 comments on commit 90f0baf

Please sign in to comment.