Skip to content

Commit 32ad18f

Browse files
committed
Fix exposedHeaders
1 parent a0c6752 commit 32ad18f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CorsService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ private function normalizeOptions(array $options = []): array
5454
'maxAge' => 0,
5555
];
5656

57-
if (!is_array($options['exposedHeaders'])) {
58-
throw new \RuntimeException("CORS option `exposed_headers` should be `false` or an array");
57+
if ($options['exposedHeaders'] && !is_array($options['exposedHeaders'])) {
58+
throw new \RuntimeException("CORS option `exposedHeaders` should be `false` or an array");
5959
}
6060

6161
foreach (['allowedOrigins', 'allowedOriginsPatterns', 'allowedHeaders', 'allowedMethods'] as $key) {

0 commit comments

Comments
 (0)