nitro icon indicating copy to clipboard operation
nitro copied to clipboard

fix(aws-lambda): fix normalizeIncomingHeaders

Open huang-julien opened this issue 2 years ago β€’ 1 comments

πŸ”— Linked issue

resolve #333

❓ Type of change

  • [ ] πŸ“– Documentation (updates to the documentation or readme)
  • [x] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • [ ] πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • [ ] ✨ New feature (a non-breaking change that adds functionality)
  • [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Hi this PR aims to fix the normalizeIncomingHeaders function from the aws-lambda preset. Some of us might test the build through aws API Gateway service which don't send any headers by default (null). The changes are just making the headers param possibly undefined and send an empty object to Object.entries if headers is null or undefined

πŸ“ Checklist

  • [x] I have linked an issue or discussion.
  • [ ] I have updated the documentation accordingly.

huang-julien avatar Aug 12 '22 18:08 huang-julien

Codecov Report

Merging #418 (76133e8) into main (801bc28) will increase coverage by 0.25%. The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
+ Coverage   55.96%   56.21%   +0.25%     
==========================================
  Files          54       54              
  Lines        3472     3467       -5     
  Branches      364      366       +2     
==========================================
+ Hits         1943     1949       +6     
+ Misses       1178     1165      -13     
- Partials      351      353       +2     
Impacted Files Coverage Ξ”
src/rollup/plugins/handlers.ts 61.90% <ΓΈ> (+22.61%) :arrow_up:
src/nitro.ts 79.22% <0.00%> (-6.08%) :arrow_down:
src/imports.ts 89.47% <0.00%> (-5.77%) :arrow_down:
src/presets/netlify.ts 24.41% <0.00%> (-3.76%) :arrow_down:
src/dirs.ts 44.44% <0.00%> (ΓΈ)
src/utils/index.ts 24.34% <0.00%> (ΓΈ)
src/prerender.ts 67.34% <0.00%> (+0.91%) :arrow_up:
src/options.ts 86.91% <0.00%> (+0.97%) :arrow_up:
src/scan.ts 43.02% <0.00%> (+3.54%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 12 '22 18:08 codecov[bot]

Thanks

pi0 avatar Aug 24 '22 19:08 pi0