force application/json for the 202 if there are no messages in the queue when building a json response (#295)

This commit is contained in:
johnhunt-lc 2026-05-08 03:56:36 -04:00 • committed by GitHub
commit a929548f33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -144,7 +144,8 @@ class StreamableHttpTransport extends BaseTransport
$outgoingMessages = $this->getOutgoingMessages($this->sessionId);
if (empty($outgoingMessages)) {
return $this->responseFactory->createResponse(202);
return $this->responseFactory->createResponse(202)
->withHeader('Content-Type', 'application/json');
}
$messages = array_column($outgoingMessages, 'message');