Skip to content

fix: 🐛 should trigger response event when follow redirect #361

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

Conversation

denghongcai
Copy link
Contributor

@denghongcai denghongcai commented Jun 4, 2021

现有 followRedirect 的情况下,response 事件只会触发一次(redirect 之后的请求的 response),request 会触发两次(redirect 前请求的 resquest 和 request 之后的 response)

@codecov
Copy link

codecov bot commented Jun 4, 2021

Codecov Report

Merging #361 (b635b1a) into master (4e06bbb) will increase coverage by 49.11%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #361       +/-   ##
===========================================
+ Coverage   44.05%   93.17%   +49.11%     
===========================================
  Files           6        6               
  Lines         799      820       +21     
  Branches      218      221        +3     
===========================================
+ Hits          352      764      +412     
+ Misses        447       56      -391     
Impacted Files Coverage Δ
lib/urllib.js 96.22% <100.00%> (+51.29%) ⬆️
lib/detect_proxy_agent.js 84.21% <0.00%> (+5.26%) ⬆️
lib/httpclient.js 100.00% <0.00%> (+53.65%) ⬆️
lib/httpclient2.js 96.22% <0.00%> (+75.47%) ⬆️

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 4e06bbb...b635b1a. Read the comment docs.

@denghongcai denghongcai changed the title fix: 🐛 should trigger response event when follow redirect [WIP] fix: 🐛 should trigger response event when follow redirect Jun 4, 2021
@denghongcai denghongcai changed the title [WIP] fix: 🐛 should trigger response event when follow redirect fix: 🐛 should trigger response event when follow redirect Jun 4, 2021
@denghongcai denghongcai requested a review from dead-horse June 4, 2021 09:09
@@ -38,6 +38,7 @@ describe('test/urllib_promise.test.js', function () {
timeout: 20000
})
.then(function (result) {
console.dir(result);
Copy link
Member

Choose a reason for hiding this comment

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

remove this console?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@dead-horse dead-horse left a comment

Choose a reason for hiding this comment

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

others LGTM

@dead-horse dead-horse merged commit 04734a1 into node-modules:master Jun 7, 2021
@dead-horse
Copy link
Member

2.37.2 released

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

Successfully merging this pull request may close these issues.

None yet

2 participants