Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We have a bit of a convenience issue. We force all users to log in via https, and their sessions aren't valid over http. The environment switcher builds http links, so even if the user has a current session to the environment she's switching to, the switcher will take her to a 403 error page. Is there a way to make these links inherit the current URL's protocol, or to use a // protocol-less link?
Comments
Comment #1
e0ipsoAbsolutely. I've had this in my backlog for some time now. I'll get to it asap.
Comment #2
wrd CreditAttribution: wrd commentedAwesome, thanks!
Comment #3
komlenic CreditAttribution: komlenic as a volunteer commentedI have a similar use case that would require a different solution. Why not make it such that you can specify the protocol to use for each environment in the environment switcher? By default, a protocol relative url could be used, but we have use cases where some of the environments require https and some require the use of http.
Comment #4
e0ipso@komlenic that's a more slightly complicated setup than I imagined. Do you have a patch proposal?
Comment #5
komlenic CreditAttribution: komlenic as a volunteer commentedAs the module works now (AFAIK), it is using the protocol on the current request, to build the links used in the environment switcher (combined with the hostname from each environment's configuration page). I would suggest adding an additional field to the environment configuration page to supply the protocol, which would then be used when building the links in the environment switcher.
Comment #6
ñull CreditAttribution: ñull as a volunteer commentedI did not see this issue before. You find a patch at this #2599024: Environment switching SSL support that might help.