mhart / aws4

Signs and prepares Node.js requests using AWS Signature Version 4
MIT License
703 stars 176 forks source link

Add custom signed headers #148

Closed H4kim closed 1 year ago

H4kim commented 1 year ago

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 1 year ago

[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"
   }
};