That solved it! Thank you, Christian, for the outstanding support, as always. I always panic a bit when I have to think about using something other than BaseX for my programming needs ;)
Tim On Wed, Feb 2, 2022 at 6:08 PM Christian Grün <christian.gr...@gmail.com> wrote: > Thanks. > > > The server is MarkLogic, s maybe they are biased against BaseX ;) I'm > not sure about the configuration, but replacing the User-Agent header with > "curl/7.71.1" didn't help. > > Fraudulent competition ;·) > > I’m particularly confused by the response code: 502 usually indicates > a server-side configuration error, which should not be triggerable > from a client. > > I noticed it would be more correct if BaseX had not sent a second > request if the response code is unequal to 401. In our case, it might > have proven to be helpful, as we can see that > > a) the response to the second request is 401, and > b) it contains the Digest WWW-Authenticate header. > > In addition, the second request contains a Content-Length header, > which is missing in the first request. Presumably, due to the missing > Content-Length:0 header, the server tries to retrieve a body, but > gives up after the timeout and returns 502. > > With the latest snapshot [1], I’m now creating an explicit > 0-bytes-body for all methods except for GET and TRACE. Does this help? > > > I noticed that in both curl and Postman the first request says, "[HTTP > request 1/2]," whereas BaseX says, "[HTTP request 1/1]" > > My hope is that numerous of these irregularities will disappear once > we’ll have switched to the new JDK 11 HTTP Client [2] with BaseX 10. > > [1] https://files.basex.org/releases/latest/ > [2] https://openjdk.java.net/groups/net/httpclient/intro.html >