cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl failed to create/upload file with digest authentication when header "If-None-Match: *" is added

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sat, 26 Jan 2013 10:32:26 +0100

On Fri, Jan 25, 2013 at 06:38:49PM +0000, Yingping Lu wrote:
> WeĒd like to make sure we donĒt overwrite an existing object when we upload a
> file to a server, so we put a header "If-None-Match: *", however, the upload
> operation always failed with digest authentication. I tracked the code a bit
> and found out that libcurl was sending two requests, the first request had
> content-length of 0, the server side responded with creating the object. The
> second request had the real length, but the operation failed since the request
> had header "If-None-Match: *", and the object was created by the first request,
> so the server side responded with http code 413, i.e. precondition failed. Is
> this the serverĒs issue or libcurlĒs issue? Thanks.

Can you show actual options used and output trace that show what you're seeing?
There are some code paths where libcurl legitimately sends more than one
request, so it's important to know whether the behaviour you're seeing is
expected in this case or not. It sounds like not, but we need more details to
see what could be going on.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-01-26