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

fix: the req data should be consumed on error #33

Merged
merged 2 commits into from
Aug 19, 2018

Conversation

fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Aug 18, 2018

@codecov
Copy link

codecov bot commented Aug 18, 2018

Codecov Report

Merging #33 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #33      +/-   ##
==========================================
+ Coverage   98.11%   98.18%   +0.06%     
==========================================
  Files           1        1              
  Lines          53       55       +2     
==========================================
+ Hits           52       54       +2     
  Misses          1        1
Impacted Files Coverage Δ
index.js 98.18% <100%> (+0.06%) ⬆️

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 7ce47c6...03dedaf. Read the comment docs.

@@ -29,6 +30,9 @@ module.exports = function onerror(app, options) {
// to node-style callbacks.
if (err == null) return;

// ignore all pedding request stream
if (this.req) sendToWormhole(this.req);
Copy link
Member

Choose a reason for hiding this comment

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

这个会不会有什么异常

Copy link
Member Author

Choose a reason for hiding this comment

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

sendToWormhole 已经将 req 的异常情况都处理了。

@popomore
Copy link
Member

LGTM

@fengmk2 fengmk2 force-pushed the make-sure-req-data-was-consumed branch from 76b3ce8 to e7e012e Compare August 18, 2018 16:56
@fengmk2 fengmk2 merged commit d4291c2 into master Aug 19, 2018
@fengmk2 fengmk2 deleted the make-sure-req-data-was-consumed branch August 19, 2018 15:37
@fengmk2
Copy link
Member Author

fengmk2 commented Aug 19, 2018

4.1.0

fengmk2 added a commit to eggjs/egg-multipart that referenced this pull request Aug 19, 2018
The stream will be auto consume by koa-onerror
see koajs/onerror#33
fengmk2 added a commit to eggjs/egg-multipart that referenced this pull request Aug 19, 2018
The stream will be auto consume by koa-onerror
see koajs/onerror#33

closes eggjs/egg#2897
fengmk2 added a commit to eggjs/egg-multipart that referenced this pull request Aug 20, 2018
The stream will be auto consume by koa-onerror
see koajs/onerror#33

closes eggjs/egg#2897
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

handle unconsume multipart request data in egg itself.
3 participants