AWS S3 servers are mad. You can do an unclear "pre-signing" operation
on them, but only for a single method (eg. just GET). This means that
the way we get the size of the export, by first querying the headers
with HEAD and then using GET for partial data transfers, does not work.
In theory we can get around this by falling back to using GET if we
notice that the HEAD operation failed, and then dropping the
connection when the server starts sending data. I restricted the
fallback behaviour so it only happens when we see the expected
403 Forbidden error from AWS.
I haven't been able to test it against a real server, but I modified
our internal test web server so it can behave like this and added a
test.
Fixes:
https://github.com/kubevirt/containerized-data-importer/issues/2737
Rich.