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
Hello! Could you please evaluate the situation below and determine if it's necessary to implement an improvement?
When using Client.Default, and the server responds with:
HTTP code: >= 400
Header: Content-Encoding: gzip (or deflate)
Body: "empty"
The following exception occurs:
java.lang.NullPointerException: null
at java.base/java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:84) ~[na:na]
at java.base/java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:77) ~[na:na]
at java.base/java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:91) ~[na:na]
at feign.Client$Default.convertResponse(Client.java:138) ~[feign-core-13.3.jar:na]
at feign.Client$Default.execute(Client.java:107) ~[feign-core-13.3.jar:na]
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:100) ~[feign-core-13.3.jar:na]
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:70) ~[feign-core-13.3.jar:na]
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:99) ~[feign-core-13.3.jar:na]
at com.example.feign_example.$Proxy63.test(Unknown Source) ~[na:na]
Below is an example of an endpoint that reproduces this response:
@PostMapping("/empty-body")
public ResponseEntity<byte[]> emptyBody() {
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_ENCODING, "gzip");
return ResponseEntity.status(HttpStatus.BAD_REQUEST).headers(headers).build();
}
In my opinion, the ideal result would be for a FeignException to occur with the HTTP code returned by the server, just as it does when the response body is not empty.
The text was updated successfully, but these errors were encountered:
Hello! Could you please evaluate the situation below and determine if it's necessary to implement an improvement?
When using Client.Default, and the server responds with:
The following exception occurs:
Below is an example of an endpoint that reproduces this response:
In my opinion, the ideal result would be for a FeignException to occur with the HTTP code returned by the server, just as it does when the response body is not empty.
The text was updated successfully, but these errors were encountered: