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

with http mocked out: Wrong host, port, and Host header extracted from concurrent requests to different hosts #19

Merged
merged 1 commit into from
Aug 25, 2016

Conversation

papandreou
Copy link
Member

@papandreou papandreou commented Jul 15, 2016

See the failing test.

It happens because lastHijackedSocket and lastHijackedSocketOptions, which are saved in the connect handler here aren't necessarily paired up with the values that are used in the request handler here.

This is somewhat predictable, and I raised the issue about a year and a half ago without it getting too much attention: moll/node-mitm#14

We'll probably need to get that implemented somehow so we can get rid of all the lastHijackedSocket... hacks.

@papandreou papandreou force-pushed the fail/concurrentRequestsToDifferentHosts branch from 645c4bf to c411666 Compare August 3, 2016 01:21
@papandreou
Copy link
Member Author

@alexjeffburke This is the fix I had in mind.

@coveralls
Copy link

coveralls commented Aug 3, 2016

Coverage Status

Coverage decreased (-0.2%) to 95.329% when pulling c411666 on fail/concurrentRequestsToDifferentHosts into 89bd982 on master.

@coveralls
Copy link

coveralls commented Aug 3, 2016

Coverage Status

Coverage remained the same at 95.541% when pulling c411666 on fail/concurrentRequestsToDifferentHosts into 89bd982 on master.

Use req.connection._mitm.{client,opts} instead of trying to keep track of the last hijacked socket and options. Fixes failing test.
@papandreou papandreou force-pushed the fail/concurrentRequestsToDifferentHosts branch from c411666 to 6c3c53c Compare August 25, 2016 07:49
@papandreou
Copy link
Member Author

@alexjeffburke This problem bit me again, so I forked mitm once more and rebased this branch. I would like to include this in 9.2.0.

@papandreou
Copy link
Member Author

Should be ready to merge if CI is green.

@coveralls
Copy link

coveralls commented Aug 25, 2016

Coverage Status

Coverage remained the same at 96.203% when pulling 6c3c53c on fail/concurrentRequestsToDifferentHosts into bc07b50 on master.

@alexjeffburke
Copy link
Member

Like that this both fixes a nasty bug and very much cleans things up - lastHijackedSocket -> clientSocket 👍

@alexjeffburke alexjeffburke merged commit ce1572b into master Aug 25, 2016
@alexjeffburke alexjeffburke deleted the fail/concurrentRequestsToDifferentHosts branch September 25, 2016 14:45
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.

3 participants