Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/main/java/io/a2a/http/JdkA2AHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public CompletableFuture<Void> getAsyncSSE(
Consumer<String> messageConsumer,
Consumer<Throwable> errorConsumer,
Runnable completeRunnable) throws IOException, InterruptedException {
HttpRequest request = createRequestBuilder(false)
HttpRequest request = createRequestBuilder(true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The Accept header is correctly set for SSE GET requests. However, a similar issue exists for POST requests. The postAsyncSSE method calls createRequestBuilder(false), preventing the Accept: text/event-stream header from being set for streaming POST requests. To ensure consistency, apply a similar fix to postAsyncSSE.

Suggested change
HttpRequest request = createRequestBuilder(true)
HttpRequest request = createRequestBuilder(true)
.build();

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChenKangQiang Thanks for the PR! A similar change should also be made in the postAsyncSSE method as mentioned here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. now i have fix

.build();
return super.asyncRequest(request, messageConsumer, errorConsumer, completeRunnable);
}
Expand Down