diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-09-02 10:50:19 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-09-02 10:53:59 -0400 |
commit | 61fa7917ab15e46892211f712e554eaccf8857fb (patch) | |
tree | 11a089d2b76a45708bed85d4b17ab0a72761410f /lib | |
parent | 39d3a137834aa90350e1947b734e003986bd5d78 (diff) | |
download | web-request-61fa7917ab15e46892211f712e554eaccf8857fb.tar.gz web-request-61fa7917ab15e46892211f712e554eaccf8857fb.zip |
add Web::Response->to_app (backported from Plack e3d0dde)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Web/Response.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Web/Response.pm b/lib/Web/Response.pm index ae22bc0..f9d0bb5 100644 --- a/lib/Web/Response.pm +++ b/lib/Web/Response.pm @@ -158,6 +158,11 @@ sub finalize { }); } +sub to_app { + my $self = shift; + return sub { $self->finalize }; +} + sub _finalize_streaming { my $self = shift; @@ -360,6 +365,11 @@ Returns a valid L<PSGI> response, based on the values given. This can be either an arrayref or a coderef, depending on if an immediate or streaming response was provided. If both were provided, the streaming response will be preferred. +=method to_app + +Returns a PSGI application which just returns the response in this object +directly. + =cut 1; |