Plack-Middleware-XSRFBlock
view release on metacpan or search on metacpan
README.mkdn view on Meta::CPAN
## cookie\_handler($self, $request, $env, $res, $token)
sets the given token as a cookie in the response
## filter\_response\_html($self, $request, $env, $res, $token)
Filters the response, injecting `<input>` elements with the token
value into all forms whose method matches `http_method_regex`.
Streaming responses are still streaming after the filtering.
## filter\_response($self, $request, $env)
Calls the application, and (if the response ["`should_be_filtered`"](#should_be_filtered)), it injects the token in the cookie and (if ["`inject_form_input`"](#inject_form_input)) the forms.
## invalid\_signature($self, $value)
Returns true if the value is not correctly signed. If we're not
signing tokens, this method always returns false.
lib/Plack/Middleware/XSRFBlock.pm view on Meta::CPAN
=head2 cookie_handler($self, $request, $env, $res, $token)
sets the given token as a cookie in the response
=head2 filter_response_html($self, $request, $env, $res, $token)
Filters the response, injecting C<< <input> >> elements with the token
value into all forms whose method matches C<http_method_regex>.
Streaming responses are still streaming after the filtering.
=head2 filter_response($self, $request, $env)
Calls the application, and (if the response L<< /C<should_be_filtered>
>>), it injects the token in the cookie and (if L<<
/C<inject_form_input> >>) the forms.
=head2 invalid_signature($self, $value)
Returns true if the value is not correctly signed. If we're not
( run in 0.250 second using v1.01-cache-2.11-cpan-4d50c553e7e )