These fields are used to conditionally download or head files in S3 when
you know the MD5 checksum (e.g. if you have a local copy and want to
avoid a redownload). If-None-Match will throw a 304 not modified status
error if the etag matches. Conversely, If-Match will throw a 412
precondition failed if the etag does not match. Both of these cases are
tested for and documented in the field haddocks.
As a side note, I needed to borrow some status handling code from HeadObject for GetObject. It was very important to get a consistent type of exception to catch when using these ETag headers because the user will usually be explicitly catching those errors.
I've run the tests locally and they pass. In order to run them for yourself you'll need to run it with --run-with-aws-credentials --bucket some-bucket-the-test-can-use.
These fields are used to conditionally download or head files in S3 when you know the MD5 checksum (e.g. if you have a local copy and want to avoid a redownload). If-None-Match will throw a 304 not modified status error if the etag matches. Conversely, If-Match will throw a 412 precondition failed if the etag does not match. Both of these cases are tested for and documented in the field haddocks.
As a side note, I needed to borrow some status handling code from HeadObject for GetObject. It was very important to get a consistent type of exception to catch when using these ETag headers because the user will usually be explicitly catching those errors.
I've run the tests locally and they pass. In order to run them for yourself you'll need to run it with
--run-with-aws-credentials --bucket some-bucket-the-test-can-use
.