fix: resolve the server 406 error in API calls (#203)

This commit is contained in:
A-afflatus 2025-05-21 11:16:48 +08:00 • committed by GitHub
commit 8222e18e40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -88,8 +88,7 @@ impl StreamableHttpClient for reqwest::Client {
) -> Result<StreamableHttpPostResponse, StreamableHttpError<Self::Error>> {
let mut request = self
.post(uri.as_ref())
.header(ACCEPT, EVENT_STREAM_MIME_TYPE)
.header(ACCEPT, JSON_MIME_TYPE);
.header(ACCEPT, [EVENT_STREAM_MIME_TYPE, JSON_MIME_TYPE].join(", "));
if let Some(auth_header) = auth_token {
request = request.bearer_auth(auth_header);
}