Catalyst-Plugin-HTML-Scrubber
view release on metacpan or search on metacpan
lib/Catalyst/Plugin/HTML/Scrubber.pm view on Meta::CPAN
444546474849505152535455565758596061626364
}
}
sub
html_scrub {
my
(
$c
,
$conf
) =
@_
;
# Firstly, if an entry in ignore_urls matches, then we don't want to
# scrub anything for this request...
return
if
(
$c
->_req_path_exempt_from_scrubbing(
$conf
));
# If there's body_data - for e.g. a POSTed JSON body that was decoded -
# then we need to walk through it, scrubbing as appropriate; don't call
# body_data unless the content type is one there's a data handler for
# though, otherwise we'll trigger an exception (see GH#4)
if
(
exists
$c
->req->data_handlers->{
$c
->req->content_type }) {
if
(
my
$body_data
=
$c
->request->body_data) {
$c
->_scrub_recurse(
$conf
,
$c
->request->body_data);
}
}
# And if Catalyst::Controller::REST is in use so we have $req->data,
( run in 0.235 second using v1.01-cache-2.11-cpan-454fe037f31 )