falcon
falcon copied to clipboard
rack.url_scheme is being set incorrectly on Heroku
We're attempting to migrate our Heroku hosted application to Falcon, but hitting an issue where rack.url_scheme in the request environment seems to be incorrectly set to http rather than https - this causes all requests to be intercepted by some middleware and throws us into an infinite loop of responses with a 307 status code redirecting to the SSL version of the URL.
The attached screenshot shows the interpreted protocol - the purple line indicates HTTPS, while the orange one is HTTP. As you can see when we deployed Falcon into our staging environment the protocol switched for all requests, and then returns to HTTPS when we deploy with Puma instead.

Monitoring is being done via Honeycomb, using their rack-honeycomb gem - the specific line in question can be found here, which indicates somewhere in Falcon's HTTP stack the URL scheme is not being set.
thanks for your report I will investigate.
Its probably not the cleanest possible fix, but I think I've tracked down the source and will submit a PR once I've tidied it up a bit.
Awesome, I will review it in the next day or two.