Bug 28367: Fix plack condition in C4/Auth_with_shibboleth.pm

C4/Auth_with_shibboleth.pm has:
  if ( any { /(^psgi\.|^plack\.)/i } keys %ENV )
When others have:
  if ( any { /(^psgi\.|^plack\.)/i } keys %ENV )

This has been highlighted by https://gitlab.com/koha-community/koha-testing-docker/-/issues/249 that introduces a PLACK_WORKERS env vars, and t/Auth_with_shibboleth.t was failing with

 #   Failed test 'checkpw_shib tests'
 #   at t/Auth_with_shibboleth.t line 335.
 Invalid parameter passed, categorycode= does not exist# Looks like your test exited with 255 just after 5.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-05-18 10:43:05 +02:00
parent d5c155203e
commit 21d8298c77
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ sub _sync {
my %borrower;
$borrower{'borrowernumber'} = $borrowernumber;
while ( my ( $key, $entry ) = each %{$config->{'mapping'}} ) {
if ( any { /(^psgi|^plack)/i } keys %ENV ) {
if ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) {
$borrower{$key} = ( $entry->{'is'} && $ENV{"HTTP_" . uc($entry->{'is'}) } ) || $entry->{'content'} || '';
} else {
$borrower{$key} = ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || '';