Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

Site-wide HTTPS difficult to enforce programatically

#4461

It would be nice if there was a simple way to flip a setting and have all generated urls use HTTPS proto instead of HTTP. So, I threw together a quick patch (attached) to do just that (granted against an older version of actionpack - so your mileage may vary).

To force all routes to use 'https' you would simply do the following in your routes.rb (or environment.rb, or wherever...):

ActionController.UrlWriter.default_proto = 'https'

Reported by rabbitt · April 23rd, 2010 @ 06:40 AM

State: stale
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Ryan Bigg
    Ryan Bigg

    It would be better if this option was called default_protocol rather than default_proto. Could you also try applying this patch to master and writing some tests for it?

    April 24th, 2010 @ 10:58 AM

  2. rabbitt
    rabbitt

    Sure thing - I'll put something together by Monday or Tuesday.

    Cheers!,

    -- Carl

    April 24th, 2010 @ 08:05 PM

  3. Neeraj Singh
    Neeraj Singh

    Attached is code patch against rails3 edge.

    Could not add any test because introduction of app.config is causing problem and I don't really know how to inject app in the concerned class/module in test environment. If anyone has any tips on how to write test then let me know.

    April 25th, 2010 @ 12:15 PM

  4. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open
    • Importance changed from to Low

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:43 PM

  5. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:43 PM