![]() |
![]()
| ![]() |
![]()
NAMEPlack::Middleware::Headers - modify HTTP response headers VERSIONversion 0.11 SYNOPSISuse Plack::Builder; builder { enable 'Headers', set => ['X-Plack-One' => '1'], append => ['X-Plack-Two' => '2'], unset => ['X-Plack-Three']; enable 'Headers', code => '404', set => ['X-Robots-Tag' => 'noindex, noarchive, follow']; enable 'Headers', when => ['Content-Type' => qr{^text/}], set => ['Content-Type' => 'text/plain']; sub {['200', [], ['hello']]}; }; DESCRIPTIONThis Plack::Middleware simplifies creation ("set" or "append"), deletion ("unset"), and modification ("set") of PSGI response headers. The modification can be enabled based on response code ("code") or existing response headers("when"). Use Plack::Middleware::Conditional to enable the middleware based in request headers. CONFIGURATION
CONTRIBUTORSThis module is an extened fork of Plack::Middleware::Header, originally created by Masahiro Chiba. Additional contributions by Wallace Reis. SEE ALSOPlack::Middleware, Plack::Builder AUTHORJakob Voß COPYRIGHT AND LICENSEThis software is copyright (c) 2014 by Jakob Voß. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
|