Skip to content

Commit

Permalink
Don't touch the headers at all
Browse files Browse the repository at this point in the history
  • Loading branch information
jellybob committed Nov 12, 2019
1 parent 70f79c3 commit 83ac77c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/falcon/adapters/rack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def unwrap_request(request, env)
# https://tools.ietf.org/html/rfc7239#section-5.4
# https://github.com/rack/rack/issues/1310
env[HTTP_X_FORWARDED_PROTO] ||= request.scheme
env[RACK_URL_SCHEME] = env[HTTP_X_FORWARDED_PROTO]

if remote_address = request.remote_address
env[REMOTE_ADDR] = remote_address.ip_address if remote_address.ip?
Expand Down Expand Up @@ -158,11 +159,6 @@ def call(request)

self.unwrap_request(request, env)

unless request.headers["x-forwarded-proto"].nil?
request.scheme = request.headers["x-forwarded-proto"].first
env[RACK_URL_SCHEME] = request.scheme
end

if request.push?
env[RACK_EARLY_HINTS] = EarlyHints.new(request)
end
Expand Down

0 comments on commit 83ac77c

Please sign in to comment.