In my Cloudflare worker, signing fails unless I remove these headers first:
'cf-connecting-ip',
'cf-ipcountry',
'cf-ray',
'x-forwarded-for',
'x-real-ip',
In my case, I'm working around like this:
// Signing will fail if these headers are present 🤷
const unsignableHeaders = [
'cf-connecting-ip',
'cf-ipcountry',
'cf-ray',
'x-forwarded-for',
'x-real-ip',
];
unsignableHeaders.forEach((name) => {
console.log("Removing unsignable header", name);
originRequest.headers.delete(name);
});
return aws.sign(originRequest);
Perhaps there should be an option to pass unsignableHeaders as an option?