spring-media / aws-lambda-router

Improved routing for AWS Lambda like SNS and ApiGateway
Apache License 2.0
98 stars 52 forks source link

Allow defaultHeaders to be added to the OPTIONS request #53

Closed TerryMooreII closed 4 years ago

TerryMooreII commented 4 years ago

This PR will allow the headers specified in the defaultHeaders config object to be added to the OPTIONS request but will not add the default Content-Type header to the OPTIONS (unless specified in the defaultHeaders object). Again, this does not break backwards compatibility.

codecov-commenter commented 4 years ago

Codecov Report

Merging #53 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #53   +/-   ##
=======================================
  Coverage   89.16%   89.16%           
=======================================
  Files           6        6           
  Lines         277      277           
  Branches       85       84    -1     
=======================================
  Hits          247      247           
  Misses         30       30           
Impacted Files Coverage Δ
lib/proxyIntegration.ts 87.75% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9fd7b67...6deec9c. Read the comment docs.

brianhyder commented 4 years ago

For context, we use the Strict-Transport-Security header across all of our endpoints. To ensure consistency, we need to be able to apply this header across all HTTP methods. The big reason is that AWS does not allow you to do response mappings with proxy integrations therefore it has to be added by the lambda proxy's response.