Skip to content

Commit e115158

Browse files
refactor: replace array_merge with array union for cleaner CORS headers initialization
Co-authored-by: Antoine Bluchet <[email protected]>
1 parent 7c12b85 commit e115158

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Server/Transport/StreamableHttpTransport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ public function __construct(
5656
$sessionIdString = $this->request->getHeaderLine('Mcp-Session-Id');
5757
$this->sessionId = $sessionIdString ? Uuid::fromString($sessionIdString) : null;
5858

59-
$this->corsHeaders = array_merge([
59+
$this->corsHeaders = $corsHeaders + [
6060
'Access-Control-Allow-Origin' => '*',
6161
'Access-Control-Allow-Methods' => 'GET, POST, DELETE, OPTIONS',
6262
'Access-Control-Allow-Headers' => 'Content-Type, Mcp-Session-Id, Mcp-Protocol-Version, Last-Event-ID, Authorization, Accept',
63-
], $corsHeaders);
63+
];
6464
}
6565

6666
public function initialize(): void

0 commit comments

Comments
 (0)