On Thu, 2018-10-11 at 15:41 +0500, Adam Retter wrote:
> > 
> > 1. Turn on 'expect-continue' handshake. It is intended precisely
> > for
> > such situations.
> > 
> 
> So I assume that for this I just set the HTTP Header, like so:
> 
> httpPut.setHeader("Expect", "100-continue");
> 
> 

There is a RequestConfig option for that.

> If so, unfortunately that is not helping the request from the client
> now
> looks like:
> 
> PUT /exist/rest/db/mediumfile.xml HTTP/1.1
> Expect: 100-continue
> Transfer-Encoding: chunked
> Content-Type: application/xml
> Host: localhost:8080
> Connection: Keep-Alive
> User-Agent: Apache-HttpClient/4.5.6 (Java/1.8.0_162)
> Accept-Encoding: gzip,deflate
> 
> The server almost immediately responds with
> 
> HTTP/1.1 100 Continue
> 
> The client then starts sending data, during which, the server
> responds with:
> 
> HTTP/1.1 401 Unauthorized
> Date: Thu, 11 Oct 2018 10:37:39 GMT
> WWW-Authenticate: Basic realm="exist"
> Content-Length: 0
> Server: Jetty(9.4.10.v20180503)
> 
> The server then closes the connection. I then get the same Broken
> pipe
> (Write failed) exceptions back from the Apache HTTP Client.
> 
> Does this mean that the server is also not behaving correctly? i.e.
> because
> it returns 100 before it checks the authorization stuff? or is that
> also
> allowed by the spec?
> 

Unfortunately this is legal from the HTTP spec standpoint even though
this behavior is just plain silly. 

I have pointed it out to the Jetty developers a long time ago but they
said they liked it that way.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to