X-Git-Url: https://ruderich.org/simon/gitweb/?p=nsscash%2Fnsscash.git;a=blobdiff_plain;f=file.go;h=5b8fffef41b466d0c32182fb6f71fd7c77a64978;hp=e06a9bce335ccc4e4444e5f8ea9502d27df09eba;hb=5f90bfd1ae2fb737d14532d74d93e3f1c1763f99;hpb=4403833dcfc3d296dd9664b1752f722e5f64a275 diff --git a/file.go b/file.go index e06a9bc..5b8fffe 100644 --- a/file.go +++ b/file.go @@ -89,12 +89,17 @@ func fetchFile(file *File, state *State) error { t = zero // force download } + oldT := t status, body, err := fetchIfModified(file.Url, file.Username, file.Password, file.CA, &t) if err != nil { return err } if status == http.StatusNotModified { + if oldT.IsZero() { + return fmt.Errorf("status code 304 " + + "but did not send If-Modified-Since") + } log.Printf("%q -> %q: not modified", file.Url, file.Path) return nil }