Hi,We have an API which Facebook calls to download dynamic media from us (JAX-RS using standard Resteasy plugin). Unfortunately they cannot deal with a server which responds with chunked content - they have to see the content-length header. In our code, we have the byte[] we need to respond with but as soon as it goes over 8191 bytes, then our response no longer has content-length header and they fail.Code snippet:byte[] body = getBodyToRespondWith();return Response.ok(body,"image/png").build();If we try and set the content-length header manually on the response, then Quarkus removes it and sets transfer-encoding: chunked instead.
I've tried changing quarkus.http.limits.max-chunk-size to a much higher value but it does not seem to impact this behaviour.
I'm at a complete loss as to how to resolve this. Telling facebook to properly implement their HTTP client is not an option unfortunately :-(Paul
--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAO8YPTSWr0ce08bJUfLtUUohi3CDxMC2GJHe4O%3DWKxShiNGFrw%40mail.gmail.com.
On Wed, 3 Feb 2021 at 02:54, Paul Carter-Brown <pa...@ukheshe.com> wrote:Hi,We have an API which Facebook calls to download dynamic media from us (JAX-RS using standard Resteasy plugin). Unfortunately they cannot deal with a server which responds with chunked content - they have to see the content-length header. In our code, we have the byte[] we need to respond with but as soon as it goes over 8191 bytes, then our response no longer has content-length header and they fail.Code snippet:byte[] body = getBodyToRespondWith();return Response.ok(body,"image/png").build();If we try and set the content-length header manually on the response, then Quarkus removes it and sets transfer-encoding: chunked instead.I just tested this and it works fine:Is there something different about your app that causes it to be removed?I've tried changing quarkus.http.limits.max-chunk-size to a much higher value but it does not seem to impact this behaviour.This won't help. Unfortunatly for Resteasy on Vert.x this is currently hard coded: https://github.com/quarkusio/quarkus/blob/73d39594b469d31240bcc2dc1fca2121f5bcdf9e/extensions/resteasy/runtime/src/main/java/io/quarkus/resteasy/runtime/standalone/ResteasyStandaloneRecorder.java#L29