Open carlhoerberg opened 3 years ago
When a long lived HTTP connection times out and the http client has to reconnect the before_request will be executed again, but then there are already headers which I think this code will use: https://github.com/taylorfinnell/awscr-signer/blob/master/src/awscr-signer/signers/v4.cr#L83-L85
before_request
but that results in a InvalidSignatureException. It can be solved by deleting the headers first:
InvalidSignatureException
@http.before_request do |request| request.headers.delete "Authorization" request.headers.delete "X-Amz-Content-Sha256" request.headers.delete "X-Amz-Date" signer.sign(request) end
iiiiinteresting. This sounds similar to the issue I've been having in #52. I'll try your solution in my shard and see if that helps.
When a long lived HTTP connection times out and the http client has to reconnect the
before_request
will be executed again, but then there are already headers which I think this code will use: https://github.com/taylorfinnell/awscr-signer/blob/master/src/awscr-signer/signers/v4.cr#L83-L85but that results in a
InvalidSignatureException
. It can be solved by deleting the headers first: