The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

Name

Web::ComposableRequest::Config - Base class for the request configuration

Synopsis

use Moo;
my $_build_config_class = sub {
my $base = __PACKAGE__.'::Config';
my @roles = list_config_roles; @roles > 0 or return $base;
return Moo::Role->create_class_with_roles( $base, @roles );
};
has 'config' => is => 'lazy', isa => Object, builder => sub {
$_[ 0 ]->config_class->new( $_[ 0 ]->config_attr ) }, init_arg => undef;
has 'config_attr' => is => 'ro', isa => HashRef | Object | Undef,
builder => sub {}, init_arg => 'config';
has 'config_class' => is => 'lazy', isa => NonEmptySimpleStr,
builder => $_build_config_class;

Description

Base class for the request configuration

Configuration and Environment

Defines the following attributes;

encoding

The encoding used to decode all inputs, defaults to UTF-8

max_asset_size

Integer defaults to 4Mb. Maximum size in bytes of the file upload

scrubber

A string used as a character class in a regular expression. These character are scrubber from user input so they cannot appear in any user supplied pathnames or query terms. Defaults to [;\$\`&\r\n]

tempdir

Directory used to store temporary files

Subroutines/Methods

BUILDARGS

Lists the attributes of the composed class and initialises their values from supplied configuration

Diagnostics

None

Dependencies

Class::Inspector

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to http://rt.cpan.org/NoAuth/Bugs.html?Dist=Web-ComposableRequest. Patches are welcome

Acknowledgements

Larry Wall - For the Perl programming language

Author

Peter Flanigan, <pjfl@cpan.org>

License and Copyright

Copyright (c) 2017 Peter Flanigan. All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE