[Server] Fix HTTP Transport Header Compliance (#227)
* fix: added the Allow header for bad method status code * fix code style --------- Co-authored-by: Tobias Nyholm <tobias.nyholm@gmail.com>
This commit is contained in:
parent
c19d550c27
commit
f3ecb2ebd8
1 changed files with 4 additions and 0 deletions
|
|
@ -242,6 +242,10 @@ class StreamableHttpTransport extends BaseTransport
|
|||
->withHeader('Content-Type', 'application/json')
|
||||
->withBody($this->streamFactory->createStream($payload));
|
||||
|
||||
if (405 === $statusCode) {
|
||||
$response = $response->withHeader('Allow', 'POST, DELETE, OPTIONS');
|
||||
}
|
||||
|
||||
return $this->withCorsHeaders($response);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue