1Plack::Middleware::RecuUrsseirveC(o3n)tributed Perl DocuPmleanctka:t:iMoinddleware::Recursive(3)
2
3
4
6 Plack::Middleware::Recursive - Allows PSGI apps to include or forward
7 requests recursively
8
10 # with Builder
11 enable "Recursive";
12
13 # in apps
14 my $res = $env->{'plack.recursive.include'}->("/new_path");
15
16 # Or, use exceptions
17 my $app = sub {
18 # ...
19 Plack::Recursive::ForwardRequest->throw("/new_path");
20 };
21
23 Plack::Middleware::Recursive allows PSGI applications to recursively
24 include or forward requests to other paths. Applications can make use
25 of callbacks stored in "$env->{'plack.recursive.include'}" to include
26 another path to get the response (whether it's an array ref or a code
27 ref depending on your application), or throw an exception
28 Plack::Recursive::ForwardRequest anywhere in the code to forward the
29 current request (i.e. abort the current and redo the request).
30
32 This middleware passes through unknown exceptions to the outside
33 middleware stack, so if you use this middleware with other exception
34 handlers such as Plack::Middleware::StackTrace or
35 Plack::Middleware::HTTPExceptions, be sure to wrap this so
36 Plack::Middleware::Recursive gets as inner as possible.
37
39 Tatsuhiko Miyagawa
40
41 Masahiro Honma
42
44 Plack Plack::Middleware::HTTPExceptions
45
46 The idea, code and interface are stolen from Rack::Recursive and
47 paste.recursive.
48
49
50
51perl v5.32.0 2020-12-02 Plack::Middleware::Recursive(3)