thomasp85 / fiery

A flexible and lightweight web server
https://fiery.data-imaginist.com
Other
240 stars 12 forks source link

Force HTTPS with Dash for R using Fiery on Heroku #46

Open ayushnoori opened 3 years ago

ayushnoori commented 3 years ago

Hi @thomasp85 - I recently created a post on the Dash for R forum, am seeking advice regarding HTTPS routing for a Dash for R app, which (according to the documentation here) "uses the Fiery web framework under the hood." Reproducing my post below in case this is a more appropriate forum for it:

I am hosting a Dash for R web app on a Heroku Hobby Dyno using a custom domain with automatic SSL/TLS enabled (i.e., when you explicitly navigate to https://examplewebsite.org, the connection is secure. However, I would like to redirect from http://examplewebsite.org to HTTPS (i.e., force the site to use SSL/TLS). I have read the Heroku documentation which:

  1. Indicates that redirects must be performed at the application level - I must code the redirect logic into my Dash app.

  2. Recommends the use of GoogleCloudPlatform/flask-talisman for Flask apps in Python. However, I am using Dash for R, regarding which the documentation provides no recommendations. Even if I had the R-equivalent of Talisman installed, I am not sure how to explicitly access the Flask app object in Dash for R to attempt to apply it.

I've looked through the fiery::Fire and Dash::dash documentation, but can't seem to find anything that would force HTTPS. I also looked at your heroku-fiery-demo repo, but don't see anything there either.

I haven't been able to find a solution to this issue and kindly request any guidance. Thanks so much!

ayushnoori commented 3 years ago

Hi @thomasp85 - following up to kindly request your insight here. Thanks so much!