You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a server returns a 404 or 400 error (possibly other errors), and the FeignClient instance is backed using the Java 11 Http2 Client, the response will be set to OK unless a Reason-Phrase header is present in the response. Other client implementations appear to parse the status line of the response to generate this reason phrase.
I'm not certain if parsing the status line is possible, and I don't think this is actually standardized but it feels wrong getting a 404 OK or 400 OK.
@kdavisk6
Hmmm.... So I started putting in a fix then I looked at the Response model and saw the following:
/**
* Nullable and not set when using http/2
*
* See https://github.com/http2/http2-spec/issues/202
*/
public String reason() {
return reason;
}
Are we married to this comment?
If so, we can simply null the field when a reason phrase header is not present, otherwise we can make best effort to populate it.
If a server returns a 404 or 400 error (possibly other errors), and the FeignClient instance is backed using the Java 11 Http2 Client, the response will be set to OK unless a Reason-Phrase header is present in the response. Other client implementations appear to parse the status line of the response to generate this reason phrase.
I'm not certain if parsing the status line is possible, and I don't think this is actually standardized but it feels wrong getting a
404 OK
or400 OK
.The offending code appears to be:
Http2Client.java Line 78
Example Builder Used to duplicate:
I found this when I swapped out a client and had some tests that were checking for Feign Exception message contents.
The text was updated successfully, but these errors were encountered: