Closed james-antill closed 6 years ago
I've added the ability to set the timestamp according to the Last-Modified
header in the remote response. Just set Request.RemoteTime = true
.
I haven't however made this the default behavior. I wasn't able to find any scenarios in curl where this is the default behavior unless --remote-time|-R
is explicitly given.
It isn't the default in curl, but then curl cli also requires you to specify --progress-bar
, --compressed
, --location
, and --remote-name
.
As a personal thing I almost always want to know "when was this created" and not "which random time did I download it to my computer", although if you still need download time you can usually look at the ctime. But, obviously, it's upto you.
This is a real pickle! It's not the default in curl or cp, but is the default in wget... I think having it by default might be convenient when checking for remote updates. I'll enable this by default and see how the community reacts.
Though it raises a question around error handling when Last-Modified
is not available from the remote server. Should this be silently ignored? Or should it return early with an error by default? This might break many default cases.
It is the default in urlgrabber too. Both wget and urlgrabber don't fail if there is no remote last-modified, although wget does print a warning (if it's not in quiet mode).
Timestamp is now set by default, unless Request.IngoreRemoteTime
is true. Great idea, thank you.
This does most of the sane things by default, except set the last modified time to be the file's modified time (aka. --remote-time in curl).