Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Problems on 100-continue + HTTPS

Hi,

On Wed, Sep 7, 2016 at 7:56 AM, John Jiang <john.sha.jiang@xxxxxxxxx> wrote:
> But I still found something interesting.
> In my webapp, /body is a pretty simple Servlet, which just print something.

Your servlet does one important thing: it calls
request.getInputStream(), which triggers the send of the 100 Continue
response.

> If using a static file, like https://localhost:9021/index, namely,
> curl -k --http2 -H "Expect: 100-continue" -d "body"
> https://localhost:9021/index
> it looks no error.
> But if add -v option for curl, namley
> curl -vk --http2 -H "Expect: 100-continue" -d "body"
> https://localhost:9021/index
> I met: curl: (92) HTTP/2 stream 1 was not closed cleanly: CANCEL (err 8)
>
> I tried several times.
> 1. If accessing a Servlet, there is no error.
> 2. If accessing a static page, the following error raised: curl: (92) HTTP/2
> stream 1 was not closed cleanly: CANCEL (err 8)
>
> Is it a problem?

What happens is that Jetty's DefaultServlet, which serves static
content, does not read the request body (because it does not expect
one).
Because it does not read the request body, it does not send the 100
Continue response to the client.
DefaultServlet generates a 200 OK response with the static file
content as the response body.
Jetty then sees that the request is not finished, but nobody will ever
read the request body, so it generates a reset with code CANCEL to
tell the client to not send the content.
In HTTP/1.1 the server would have closed the connection.

What you see is the right behavior.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top