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

Refactor: move BodyParser to upper level #1841

Merged
merged 2 commits into from Jun 19, 2020

Conversation

hydra13
Copy link
Contributor

@hydra13 hydra13 commented Jun 16, 2020

This can be useful when the middleware plugin has to get access to the request's body.

I tried to make publication and add some field "on the fly" and didn't get access to the request's body. (link to my example plugin)

The reason for this problem was that body-parser was used in src/api/endpoint/index.ts and middleware plugins registered before ones.

My PR just moves the call of body-parser from src/api/endpoint/index.ts to src/api/index.ts (above registration middleware plugins)

@codecov
Copy link

codecov bot commented Jun 16, 2020

Codecov Report

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

@@           Coverage Diff           @@
##           master    #1841   +/-   ##
=======================================
  Coverage   83.44%   83.44%           
=======================================
  Files          48       48           
  Lines        2537     2537           
  Branches      586      594    +8     
=======================================
  Hits         2117     2117           
+ Misses        416      415    -1     
- Partials        4        5    +1     
Impacted Files Coverage Δ
src/api/endpoint/index.ts 100.00% <ø> (ø)
src/api/index.ts 82.97% <100.00%> (+0.37%) ⬆️
src/api/web/endpoint/package.ts 75.00% <0.00%> (ø)

@juanpicado juanpicado self-requested a review June 17, 2020 04:59
Copy link
Member

@juanpicado juanpicado left a comment

Choose a reason for hiding this comment

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

Thanks @hydra13 looks good to me, but I will run a few tests before the merge.

@hydra13
Copy link
Contributor Author

hydra13 commented Jun 17, 2020

Sure! Could you share the results of your test?

@sonarcloud
Copy link

sonarcloud bot commented Jun 18, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@juanpicado
Copy link
Member

Sure! Could you share the results of your test?

Are running 🙃 ... 3 new acceptant test running in 3 different package managers using latest changes. You can check the latest master commit. I guess that's good enough for me if they pass (still running)

Copy link
Member

@juanpicado juanpicado left a comment

Choose a reason for hiding this comment

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

Thanks @hydra13 hopefully this helps you.

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

Successfully merging this pull request may close these issues.

None yet

2 participants