From a929548f3397700ee345b6b2d1feecc8f53c2474 Mon Sep 17 00:00:00 2001 From: johnhunt-lc Date: Fri, 8 May 2026 03:56:36 -0400 Subject: [PATCH] force application/json for the 202 if there are no messages in the queue when building a json response (#295) --- src/Server/Transport/StreamableHttpTransport.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Server/Transport/StreamableHttpTransport.php b/src/Server/Transport/StreamableHttpTransport.php index 3c9b2f6..62e82ae 100644 --- a/src/Server/Transport/StreamableHttpTransport.php +++ b/src/Server/Transport/StreamableHttpTransport.php @@ -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');