Hi, as far as I remember, the handler.pl is called only once per application, so not once per request. No change to fiddle with %ARGS there.
I suggest doing some ad-hoc validation at argument reading time if you want to protect your DB layer from out of range identifiers. Cheers, Jerome. On 24 September 2013 14:53, Louis-David Mitterrand <vindex+lists-mason-us...@apartia.org> wrote: > Hi, > > I'd like to make sure all arguments named id_* passed to my app are > postgres-compatible int4 so I developped a small sub: > > ## sanitize all id_* args > for my $key (keys(%ARGS)) { > $key !~ /^id_/ && next; > for (ref($ARGS{$key}) eq 'ARRAY' ? @{$ARGS{$key}} : > $ARGS{$key}) { > $_ = int($_); $_ = 0 if $_ >= 2**31 > } > } > > Ideally I'd like to run that at the /etc/apache2/handler.pl level so > that I don't have to do it in each web site's autohandler. > > How can I access %ARGS from mason's init script? > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk > _______________________________________________ > Mason-users mailing list > Mason-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mason-users -- Jerome Eteve +44(0)7738864546 http://www.eteve.net/ ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users