Re: Implementing HTTP PUT

Thanks so much for your thoughtful and comprehensive letter on HTTP PUT. I
am still working through all of it, but first I thought it would be smart to
clear up my incompatibility with Amaya.

Fish <fish@infidels.org> wrote:

> Was there an "Expect: 100-continue" header in the request? If so, then you
> should have responded to the PUT request with two separate responses: the
> first being a "100 Continue" response and the second a "200 OK" final status
> response.

Aha! This seems to be the problem. Using EricP's excellent patchPannel
(thanks to Gerald and dajobe), I find that Amaya is sending the following
request:

PUT /testing HTTP/1.0
Accept: text/html
Accept-Encoding: *,deflate
TE: trailers,deflate
Expect: 100-continue
Host: logicerror.com:8000
If-Match: "2FCD2DA8CE70C6513671F8B181CCAB94F52F00B7"
User-Agent: amaya/V4.0 libwww/5.3.1
Cache-Control: no-cache
Connection: TE,Keep-Alive
Date: Wed, 28 Mar 2001 07:07:20 GMT
Content-Length: 1266
Content-Type: text/html
Last-Modified: Wed, 28 Mar 2001 07:07:20 GMT

This is interesting because it's an HTTP/1.0 request, but uses Expect:
100-continue. As the RFC you referenced states:

    An origin server [...] MUST NOT send a 100 (Continue) response if such a
    request comes from an HTTP/1.0 (or earlier) client.

So it seems odd that Amaya is expecting a response that according to the RFC
I am not allowed to send it. When I do not send the 100 continue response
Amaya sends the response body, and then crashes. This seems to be in line
with this part of the RFC:

    the client SHOULD NOT wait for an indefinite period before sending the
    request body. 

(except for the crash). I reported this to the Amaya team:

http://lists.w3.org/Archives/Public/www-amaya/2001JanMar/0264.html

(Also interesting is that I'd never seen RFC2616 -- only 2068, which I had
assumed was the latest.)

So what is the correct thing to do in this instance? Hmm, let's ask Jigsaw:

PUT /Overview.html HTTP/1.1
Accept: text/html
Accept-Encoding: *,deflate
TE: trailers,deflate
Expect: 100-continue
Host: dev.logicerror.com:8001
If-Match: "mvanct:sm348cgo"
User-Agent: amaya/V4.0 libwww/5.3.1
Cache-Control: no-cache
Connection: TE
Date: Wed, 28 Mar 2001 07:38:26 GMT
Content-Length: 3270
Content-Type: text/html
Last-Modified: Wed, 28 Mar 2001 07:38:26 GMT

----

HTTP/1.1 100 Continue
Date: Wed, 28 Mar 2001 19:29:25 GMT
Server: Jigsaw/2.2.0

----

(content of page)

----

HTTP/1.1 204 No Content
Date: Wed, 28 Mar 2001 19:29:27 GMT
Content-Length: 3270
Content-Type: text/html
Etag: "mvanct:sm3bhheo"
Last-Modified: Wed, 28 Mar 2001 19:29:27 GMT
Server: Jigsaw/2.2.0

----

Hmm. So I guess I need to return two responses. This will be difficult,
because it will need to be added to the server itself, not my code. Plus
it's a HTTP/1.0 server, so I'm not sure if it would be right to report it as
a bug.

> See RFC 2616 section 8.2.3 "Use of the 100 (Continue) Status". (But you knew
> that, right? How familiar are you with HTTP/1.1 anyway? Please understand I'm
> not bashing you; I'm just curious, that's all. It helps to know the background
> and experience of the person asking the question.)

I'm just an interested Web developer, but with little knowledge of HTTP.
Hopefully, if I can get this to work, I'll write it up for others. I'd love
to see PUT more widely available.

-- 
[ Aaron Swartz | me@aaronsw.com | http://www.aaronsw.com ]

Received on Wednesday, 28 March 2001 16:59:46 UTC