curl-users
Re: date condition
Date: Wed, 18 Dec 2002 09:03:43 +0100 (MET)
On Mon, 16 Dec 2002, Zvi Har'El wrote:
> curl -i -z "`date -r aaa`" http://host/path
>
> doesn't issue an if-modified-since request and always returns the file.
> Since the date expression generated by the date -r (or date --reference)
> command is completely legal, I suspect there is a bug here.
I can't make this not work.
I ran this command line with curl 7.9.9 and a curl 7.10.3-pre version:
$ touch aaaa
$ curl -vi -z "`date -r aaaa`" http://127.0.0.1/
[snip]
They both sent a header like this:
If-Modified-Since: Wed, 18 Dec 2002 07:58:23 GMT
and in fact, both command lines get a 304 "Not Modified" back from the
server.
> Parenthetically, there is a problem also in the "works fine" case: if you
> don't specify -i, you get nothing, not even an error return!!!
Curl doesn't return errors like that and using -z makes it no different. If
you really need to, use -w and get the http code returned, or use -i and
figure it out yourself.
-- Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs. ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/Received on 2002-12-18