'how force a Ruby Sintra app to redirect http to https
I have a classic Sinatra app which at some point just stopped redirecting http requests to https. (I'm not sure when it stopped automatically redirecting, perhaps in the last year or so when I upgraded some things including the Sinatra gem to v 2.2)
The Gemfile.lock has:
rack-ssl (1.4.1)
The app initialization contains:
require 'rack/ssl'
use Rack::SSL
None of that has changed in my code.
But currently, if I navigate to http://www.myapp.com it stays on http, instead of redirecting to https like it used to.
I've also tried adding
set :force_ssl, true
But that had no effect.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
