lemonldap-ng/lemonldap-ng-common/lib/Lemonldap/NG/Common/UserAgent.pm
2019-02-12 18:21:38 +01:00

17 lines
355 B
Perl

package Lemonldap::NG::Common::UserAgent;
use LWP::UserAgent;
our $VERSION = '2.1.0';
sub new {
my ( $class, $conf ) = @_;
my $opts = $conf->{lwpOpts} || {};
$opts->{ssl_opts} = $conf->{lwpSslOpts} if ( $conf->{lwpSslOpts} );
my $ua = LWP::UserAgent->new(%$opts);
push @{ $ua->requests_redirectable }, 'POST';
return $ua;
}
1;