>
> 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");
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?
2. Migrate to a non-blocking HTTP client such as Apache HttpAsyncClient
> 4.1 or 5.0 that can handle out of sequence responses.
>
I will give this some thought...
--
Adam Retter
eXist Core Developer
{ United Kingdom / United States }
[email protected]