Skip to content

Commit

Permalink
use $app consistently outside of Mojolicious::Lite apps
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 31, 2014
1 parent 032695b commit a12d62c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

5.36 2014-08-31
5.36 2014-09-01

5.35 2014-08-30
- Improved monkey_patch to be able to name generated functions.
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -299,7 +299,7 @@ you can use the hook L<Mojolicious/"before_dispatch"> to rewrite incoming
requests.

# Change scheme if "X-Forwarded-HTTPS" header is set
app->hook(before_dispatch => sub {
$app->hook(before_dispatch => sub {
my $c = shift;
$c->req->url->base->scheme('https')
if $c->req->headers->header('X-Forwarded-HTTPS');
Expand All @@ -310,11 +310,11 @@ prefixes your application might be deployed under, rewriting the base path of
incoming requests is also quite common.

# Move first part and slash from path to base path in production mode
app->hook(before_dispatch => sub {
$app->hook(before_dispatch => sub {
my $c = shift;
push @{$c->req->url->base->path->trailing_slash(1)},
shift @{$c->req->url->path->leading_slash(0)};
}) if app->mode eq 'production';
}) if $app->mode eq 'production';

L<Mojo::URL> objects are very easy to manipulate, just make sure that the URL
(C<foo/bar?baz=yada>), which represents the routing destination, is always
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Guides/FAQ.pod
Expand Up @@ -173,11 +173,11 @@ one.
=head2 What does "Your secret passphrase needs to be changed" mean?

L<Mojolicious> uses secret passphrases for security features such as signed
cookies. It defaults to using the moniker of your application, which is not
very secure, so we added this log message as a reminder. You can change the
cookies. It defaults to using L<Mojolicious/"moniker">, which is not very
secure, so we added this log message as a reminder. You can change the
passphrase with the attribute L<Mojolicious/"secrets">.

app->secrets(['My very secret passphrase.']);
$app->secrets(['My very secret passphrase.']);

=head2 What does "Nothing has been rendered, expecting delayed response" mean?

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Growing.pod
Expand Up @@ -358,7 +358,7 @@ using the method L<Mojolicious::Controller/"session">, there is no setup
required, but we suggest setting a more secure passphrase with
L<Mojolicious/"secrets">.

app->secrets(['Mojolicious rocks']);
$app->secrets(['Mojolicious rocks']);

This passphrase is used by the HMAC-SHA1 algorithm to make signed cookies
secure and can be changed at any time to invalidate all existing sessions.
Expand Down

0 comments on commit a12d62c

Please sign in to comment.