[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[jetty-users] Answering requests without reading body
|
Hi there,
in some case we don't want to read the full body of a request but still send a response code and headers back to the client. Think of a resource that is used for uploading 10MB large files that wants to throttle clients by sending 429 status code and Retry-After headers to the client.
We made the following observations when using the Handler API with http2:
1. If we set the status code and header manually and succeed the callback jetty throws a static exception due to unconsumed request content. This looks like a connection issue to the client because the server closes the stream without sending the info we set on the response.
2. When we fail the callback with an HttpException with the proper code, we receive that code on the client, but any headers we set before failing the callback seem to be ignored.
org.eclipse.jetty.http.HttpException seems to be handled in a special way. Is there any documentation on this and is there a way to also set headers when a callback is failed?
Thanks!
Best,
Matthias