@@ -369,6 +369,7 @@ function download_to_cache() {
369
369
write_out=' {
370
370
"http_code":%{http_code},
371
371
"last_modified":"%header{Last-Modified}",
372
+ "date":"%header{Date}",
372
373
"content_type":"%{content_type}",
373
374
"url":"%{url_effective}",
374
375
"filename":"%{filename_effective}"
@@ -377,7 +378,7 @@ function download_to_cache() {
377
378
378
379
local code time type url
379
380
code=$( jq -r ' .http_code' <<< " ${curl_info_json}" )
380
- time=$( jq -r ' .last_modified' <<< " ${curl_info_json}" )
381
+ time=$( jq -r ' ( .last_modified|select(length>1)) // .date ' <<< " ${curl_info_json}" )
381
382
type=$( jq -r ' .content_type' <<< " ${curl_info_json}" )
382
383
if [[ ${use_redirected_location} == " YES" ]]; then
383
384
url=$( jq -r ' .url' <<< " ${curl_info_json}" )
@@ -400,7 +401,7 @@ function download_to_cache() {
400
401
)
401
402
local filename
402
403
code=$( jq -r ' .http_code' <<< " ${curl_info_json}" )
403
- time=$( jq -r ' .last_modified' <<< " ${curl_info_json}" )
404
+ time=$( jq -r ' ( .last_modified|select(length>1)) // .date ' <<< " ${curl_info_json}" )
404
405
type=$( jq -r ' .content_type' <<< " ${curl_info_json}" )
405
406
url=$( jq -r ' .url' <<< " ${curl_info_json}" )
406
407
filename=$( jq -r ' .filename' <<< " ${curl_info_json}" )
0 commit comments