Skip to content

Commit ffc1da5

Browse files
authored
Handle comma separated values in Access-Control-Request-Headers
Not only may there be multiple Access-Control-Request-Headers, each header may contain a comma list of header names.
1 parent 3f6207b commit ffc1da5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Classes/Http/CorsHeaderMiddleware.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,8 @@ private function areHeadersAllowed(array $headers): bool
319319
if ($this->allowedHeadersAll || $this->allowedHeaders === []) {
320320
return true;
321321
}
322+
// each header may comma seperated itself
323+
$headers = array_merge(...array_map(fn(string $line) => explode(',' , $line), $headers));
322324
foreach ($headers as $header) {
323325
if (!in_array($header, $this->allowedHeaders, true)) {
324326
return false;

0 commit comments

Comments
 (0)