diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/AuthBasic.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/AuthBasic.pm index c2b9b6eda..576f9e067 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/AuthBasic.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/AuthBasic.pm @@ -11,12 +11,23 @@ use Lemonldap::NG::Common::UserAgent; use Lemonldap::NG::Common::FormEncode; use Lemonldap::NG::Common::Session; -our $VERSION = '2.0.7'; +our $VERSION = '2.0.15'; our @ISA = ('Exporter'); our @EXPORT = qw(fetchId retrieveSession createSession hideCookie goToPortal); our @EXPORT_OK = @EXPORT; our $_ua; +sub ua { + my ($class) = @_; + return $_ua if $_ua; + $_ua = Lemonldap::NG::Common::UserAgent->new( { + lwpOpts => $class->tsv->{lwpOpts}, + lwpSslOpts => $class->tsv->{lwpSslOpts} + } + ); + return $_ua; +} + ## @rmethod protected fetchId # Get user session id from Authorization header # Unlike usual processing, session id is computed from user creds, @@ -163,15 +174,4 @@ sub goToPortal { } } -sub ua { - my ($class) = @_; - return $_ua if ($_ua); - $_ua = Lemonldap::NG::Common::UserAgent->new( { - lwpOpts => $class->tsv->{lwpOpts}, - lwpSslOpts => $class->tsv->{lwpSslOpts} - } - ); - return $_ua; -} - 1; diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/DevOps.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/DevOps.pm index 48afedd26..41f75d51e 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/DevOps.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/DevOps.pm @@ -8,9 +8,14 @@ our $VERSION = '2.0.15'; our $_ua; sub ua { - return $_ua - ? $_ua - : Lemonldap::NG::Common::UserAgent->new( $_[0]->localConfig ); + my ($class) = @_; + return $_ua if $_ua; + $_ua = Lemonldap::NG::Common::UserAgent->new( { + lwpOpts => $class->tsv->{lwpOpts}, + lwpSslOpts => $class->tsv->{lwpSslOpts} + } + ); + return $_ua; } sub checkMaintenanceMode {