TypeError: implode(): Argument #2 ($array) must be of type ?array, bool given in implode() (line 199 of /var/www/vendor/asm89/stack-cors/src/CorsService.php) #0 /var/www/vendor/asm89/stack-cors/src/CorsService.php(199)

Created on 30 August 2023, over 1 year ago
Updated 17 January 2024, about 1 year ago

We installed the module and got this error:

TypeError: implode(): Argument #2 ($array) must be of type ?array, bool given in implode() (line 199 of /var/www/vendor/asm89/stack-cors/src/CorsService.php)
#0 /var/www/vendor/asm89/stack-cors/src/CorsService.php(199): implode(', ', true)
#1 /var/www/vendor/asm89/stack-cors/src/CorsService.php(133): Asm89\Stack\CorsService->configureExposedHeaders(Object(Drupal\Core\Routing\LocalRedirectResponse), Object(Symfony\Component\HttpFoundation\Request))
#2 /var/www/vendor/asm89/stack-cors/src/Cors.php(59): Asm89\Stack\CorsService->addActualRequestHeaders(Object(Drupal\Core\Routing\LocalRedirectResponse), Object(Symfony\Component\HttpFoundation\Request))
#3 /var/www/web/modules/contrib/shield/src/ShieldMiddleware.php(270): Asm89\Stack\Cors->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#4 /var/www/web/modules/contrib/shield/src/ShieldMiddleware.php(137): Drupal\shield\ShieldMiddleware->bypass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#5 /var/www/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\shield\ShieldMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#6 /var/www/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#7 /var/www/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 /var/www/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /var/www/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#10 {main}
.

If there is no cors settings in services.yml it works fine.

🐛 Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

🇨🇭Switzerland lukas.fischer

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024