Skip to content

Fix non-OK HTTP POST responses handling #374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chemicL
Copy link
Member

@chemicL chemicL commented Jul 4, 2025

Currently, JDK HttpClient SSE implementation incorrectly handles a non-2xx HTTP response code for POST. Instead of immediately failing the caller, it ignores the issue and the user awaits until the timeout kicks in.

A related problem happened with the WebClient Streamable HTTP implementation, where the error was swallowed for non-400 responses.

Currently, JDK HttpClient SSE implementation incorrectly handles a
non-2xx HTTP response code for POST. Instead of immediately failing the
caller, it ignores the issue and the user awaits until the timeout kicks
in.

A related problem happened with the WebClient Streamable HTTP
implementation, where the error was swallowed for non-400 responses.

Signed-off-by: Dariusz Jędrzejczyk <[email protected]>
@chemicL
Copy link
Member Author

chemicL commented Jul 4, 2025

@tzolov I noticed this change fails some cases of HttpClientSseClientTransportTests, which seem to be incorrect, as the server returns a 400 HTTP code due to incorrect input.

Also, I noticed the HttpClientSseClientTransportTests.TestHttpClientSseClientTransport has a Sink which is never consumed. I don't quite get how these tests are working.

I'll leave this in a draft state for you to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant