@@ -197,7 +197,7 @@ void McpService::sendHttpResponse(QTcpSocket *socket, int statusCode, const QByt
197197 " HTTP/1.1 %1 %2\r\n "
198198 " Content-Type: %3\r\n "
199199 " Content-Length: %4\r\n "
200- " Access-Control-Allow-Origin: * \r\n "
200+ " Access-Control-Allow-Origin: http://localhost \r\n "
201201 " Access-Control-Allow-Methods: GET, POST, OPTIONS\r\n "
202202 " Access-Control-Allow-Headers: Content-Type, Authorization\r\n "
203203 " Cache-Control: no-store\r\n "
@@ -214,7 +214,7 @@ void McpService::sendHttpResponse(QTcpSocket *socket, int statusCode, const QByt
214214void McpService::sendCorsHeaders (QTcpSocket *socket) {
215215 const QByteArray response =
216216 " HTTP/1.1 204 No Content\r\n "
217- " Access-Control-Allow-Origin: * \r\n "
217+ " Access-Control-Allow-Origin: http://localhost \r\n "
218218 " Access-Control-Allow-Methods: GET, POST, OPTIONS\r\n "
219219 " Access-Control-Allow-Headers: Content-Type, Authorization\r\n "
220220 " Access-Control-Max-Age: 86400\r\n "
@@ -243,7 +243,7 @@ void McpService::openSseStream(QTcpSocket *socket) {
243243 " HTTP/1.1 200 OK\r\n "
244244 " Content-Type: text/event-stream\r\n "
245245 " Cache-Control: no-cache\r\n "
246- " Access-Control-Allow-Origin: * \r\n "
246+ " Access-Control-Allow-Origin: http://localhost \r\n "
247247 " Connection: keep-alive\r\n "
248248 " \r\n " ;
249249
0 commit comments