Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds normalizeHttpEvent Middleware #101

Merged
merged 7 commits into from Jan 28, 2018
Merged

Conversation

i-am-kenny
Copy link
Contributor

@i-am-kenny i-am-kenny commented Jan 24, 2018

This should allow the CORS header to be applied even if the request fails. I can easily add the other headers/tests, but I wasn't sure about some reasonable defaults.

Closes #35

@codecov
Copy link

codecov bot commented Jan 24, 2018

Codecov Report

Merging #101 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #101   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          14     15    +1     
  Lines         261    267    +6     
  Branches       48     51    +3     
=====================================
+ Hits          261    267    +6
Impacted Files Coverage Δ
src/middlewares/index.js 100% <ø> (ø) ⬆️
src/middlewares/httpEventNormalizer.js 100% <100%> (ø)

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 1131b48...b8eb4c7. Read the comment docs.

Copy link
Member

@lmammino lmammino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff. Can you update tests as well?

Copy link
Member

@lmammino lmammino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic.

Only 2 things before this can be ready for the merge:

  1. I would rename withDefaultHttpEvent to normalizeHttpEvent (see Api Gateway proxy event normalizer middleware #35)
  2. We need middleware docs for normalizeHttpEvent (see https://github.com/middyjs/middy/blob/master/docs/middlewares.md) and update the list of middlewares accordingly in the README.md.hb

@lmammino
Copy link
Member

Hey @i-am-kenny, are you ok with the above comment? Do you need any kind of help/support?

@lmammino lmammino changed the title Adds onError to cors middleware. Adds normalizeHttpEvent Middleware Jan 28, 2018
Copy link
Member

@lmammino lmammino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added docs and renamed the middleware. Getting this one merged and released soon

@lmammino lmammino merged commit 43233cb into middyjs:master Jan 28, 2018
@lmammino
Copy link
Member

Merged, thanks for your precious contribution @i-am-kenny 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants