lemonldap-ng/lemonldap-ng-common/lib/Lemonldap/NG/Common/UserAgent.pm

18 lines
367 B
Perl
Raw Normal View History

2017-02-15 16:08:23 +01:00
package Lemonldap::NG::Common::UserAgent;
2020-12-19 00:01:49 +01:00
use strict;
2017-02-15 16:08:23 +01:00
use LWP::UserAgent;
2019-02-12 18:21:38 +01:00
our $VERSION = '2.1.0';
2017-02-28 21:53:19 +01:00
2017-02-15 16:08:23 +01:00
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;