Re: #535: No 1xx Status Codes

On 2 July 2014 08:30, Mark Nottingham <mnot@mnot.net> wrote:

>

> they're not well-supported in implementations nor APIs, nor intermediaries
> (IIRC).


The Jetty server has long supported 100 continues and we believe that we
have good mechanism that does not depend on explicit API support.

Specifically we delay sending the 100 continues response until the Servlet
calls the Request.getInputStream() method (or any other method that
consumes the content).     A Servlet is then free to handle the request by
inspecting the URI and headers, and if it decides that it does not wish to
consume the input, then a 100 is never sent.  The Servlet can send an
arbitrary response, but the connection is always shutdown afterward in such
cases.     If the servlet does decide to consume the input, then the 100 is
sent when the input stream is obtained and the servlet typically blocks
until the content arrives (although we now have async IO in the API to
avoid this blocking if desired).

We have never had any problems reported with this mechanism, but before we
implemented it we had frequent complaints that it was not supported,
specially by SOAP and REST frameworks. These are from non-browser clients,
so I expect that they will wish to have similar semantics available in
http/2

We also have had some usage of 102 responses, which we implement by bending
the meaning of sendError in the servlet API.    I don't think that not
support 102 will cause widespread problems, but if we do support 100, then
102 support is probably good to at least ensure the mechanism is general
for all 1xx responses.

cheers














-- 
Greg Wilkins <gregw@intalio.com>
http://eclipse.org/jetty HTTP, SPDY, Websocket server and client that scales
http://www.webtide.com  advice and support for jetty and cometd.

Received on Wednesday, 2 July 2014 09:12:14 UTC