url_scheme should honor HTTP_X_FORWARDED_PROTO
Reported by Sam Soffes | July 1st, 2010 @ 08:56 PM
Basically, on some servers (mainly Heroku)
url_scheme
is always "http"
. If it is a
page what should be https the server adds
HTTP_X_FORWARDED_PROTO
to the env with the correct
scheme.
For awhile, I've been doing the following to work around this:
env["rack.url_scheme"] = "https" if env["SERVER_PORT"] == "443"
env["rack.url_scheme"] = env["HTTP_X_FORWARDED_PROTO"] if env["HTTP_X_FORWARDED_PROTO"]
It would be great if this was part of Rack.
Comments and changes to this ticket
-
raggi May 3rd, 2011 @ 07:33 AM
- State changed from new to resolved
I think Josés patches cover this.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป