mhart/aws4

Add custom signed headers

H4kim opened this issue · 1 comments

H4kim commented

Is it possible to add custom signed headers ? i checked the docs and the code but i can't find anything!

an example:

{
  method: 'GET',
  host: '...',
  path: '....',
  service: 's3',
  region: 'us-west-1',
  headers: {
    Host: '..',
    'X-Amz-Content-Sha256': '....',
    'X-Amz-Date': '...',
    Authorization: 'AWS4-HMAC-SHA256 Credential=....., SignedHeaders=host;x-amz-content-sha256;x-amz-date,x-custom-1,x-custm-2, Signature=.....'
  }
}

H4kim commented

[SOLVER]
after checking the lib code, i found the options headers that can be added the the sign options

var opts = {
    ....
   region: "us-east-1",
   headers: {
      "x-custm-1": "value",
      "x-custm-2": "value"
   }
};