-
Notifications
You must be signed in to change notification settings - Fork 73
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
100-Continue is not correctly responded for chunked requests #2222
Comments
I have a question to make it clearer. Does this issue refer to chunked transfer coding? For example, I wonder if it refers to a request that includes a When I reviewed Grizzly source codes related to 100-continue support,
If the above is satisfied, it is expected to work well. If it is chunked transfer coding, it does not seem easy to support this feature. If you have any reference materials or scenarios, I will think about it further. |
Yes. I've uploaded the simple server application and more detailed reproduction instructions below. |
With the information you provided, I was able to reproduce it successfully. As expected, when there is content-length, 100-continue works well, In the case of Apache web server, when the work-around option above is used, the corresponding header is not delivered to Grizzly, and the web server itself processes 100-continue. In the case of nginx, I also confirmed that the web server itself processes it. I will take a closer look at how to handle cases such as chunked transfer coding when |
…chunked requests" (eclipse-ee4j#2222) Chunked Transfer Coding supports 100-continue. + In case of chunked transfer coding, "Expect: 100-continue" is processed immediately after HttpHeader is parsed. + Added tests for chunked transfer encoding to HttpContinueTest. + All tests passed. PS) However, custom sendAcknowledgment() of HttpHandler cannot be supported in that situation.
@hs536 I submitted a PR. The patch file is only org/glassfish/grizzly/http/HttpServerFilter.java. |
Grizzly implements handling for the
Expect: 100-Continue
header; however, this handling fails for chunked requests. While a 100-Continue response should be sent upon completion of parsing the header chunk containingExpect: 100-Continue
, Grizzly does not reach the following handler method and delays the response until the first byte of the subsequent body is received.grizzly/modules/http-server/src/main/java/org/glassfish/grizzly/http/server/HttpHandler.java
Lines 354 to 364 in c3dcb70
This behavior can cause timeouts, particularly when requests are proxied through Apache 2.4.x. Apache 2.4.x, when a request includes the
Expect: 100-Continue
header, waits for a 100-Continue response from the backend server before sending the request body. This creates a deadlock between Grizzly and Apache, resulting in request timeouts.While this behavior can be worked around by setting
Proxy100Continue Off
in Apache, this prevents the client from verifying server acceptance of the data before transmission.The text was updated successfully, but these errors were encountered: