Hi Tobias -

> Therefore I need to force all generated URIs to be https.

If generated URIs means those coming from $c->uri_for() and friends, you
should be able the modify the URI scheme in $c->request->base, which
gets used by uri_for().

Not tested but try something like the following.

HTH,
Larry

Side question:  Is namespace::autoclean needed any more?

==============================================

package MyApp;

use Moose;

use namespace::autoclean;

BEGIN { extends 'AL::Catalyst::Base' }

with 'MyApp::Roles::Catalyst::IsOnlyHTTPS';

use Catalyst (...);

==============================================

package MyApp::Roles::Catalyst::IsOnlyHTTPS;

use Moose::Role;

use namespace::autoclean;

after 'prepare_path' => sub {

    my $c = shift;

    $c->request->base->scheme('https');

    # Might be necessary to keep request
    # uri in sync with request base?
    # Not sure...
    #
    #$c->request->uri->scheme('https');

    return;
};

1;

==============================================

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to