Closed fucksophie closed 2 years ago
Hello, thanks for the report. This sounds like a difference between the Backblaze and AWS API implementations.
In reviewing my code, I believe that the header is being sent properly, but is not included in the signature. I suppose AWS is fine with that since the request overall is still signed.
I believe that I just need to swap these two blocks of signing code, so that x-amz-content-sha256
is computed before the request headers are observed. https://github.com/cloudydeno/deno-aws_api/blob/a383db0f0793f0211be46f039ccce9b3e49f8974/lib/client/signing.ts#L117-L133
I'll test the change with AWS for regressions when preparing a PR. I do not have a Backblaze account handy to verify any fixes, so once I attach a PR, I'd love to get a yes-or-no on whether it resolves the stated problem.
Ok, here's an importable module from the associated PR which should resolve this signing issue: https://raw.githubusercontent.com/cloudydeno/deno-aws_api/666991bff325933f28954bc4878fca6aff2f89a1/lib/client/mod.ts
I've lightly tested with real S3 and don't see any regressions there
Works perfectly. Thanks!!
code:
error:
sha256 is not sent alongside requests to b2 (b2 requires sha256's)