Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Conversation

@kamilogorek
Copy link
Contributor

Fixes #360

lib/utils.js Outdated

module.exports.prepareInitialRequest = function prepareInitialRequest() {
var request = {};
var nonEnumberables = ['ip'];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be passed as an argument, but I wasn't sure if that's worth it, as it's one-off util.

Copy link
Contributor

@MaxBittker MaxBittker left a comment

Choose a reason for hiding this comment

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

this looks like a good fix, but it's still slightly confusing and I think the comments + test would help.

lib/client.js Outdated
parseUser returns a partial kwargs object with a `request` property and possibly a `user` property
*/
var initialRequest = utils.prepareInitialRequest(
this._globalContext.request,
Copy link
Contributor

@MaxBittker MaxBittker Sep 25, 2017

Choose a reason for hiding this comment

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

would you mind adding some comments here? I'm having trouble understanding why it is needed to use both prepareInitialRequest and extend on these groups of request & req objects, instead of replacing in extend with prepareInitialRequest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was just me missing it. Fixed :)

});
});

describe('#prepareInitialRequest', function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

these tests on the prepareInitialRequest utility seem good to me, but would you mind writing a slightly broader test that recreates the original problem outlined in #360?

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.

@kamilogorek
Copy link
Contributor Author

@MaxBittker everything has been addressed

@kamilogorek kamilogorek requested review from a team and removed request for benvinegar September 26, 2017 15:38
@kamilogorek kamilogorek merged commit 343da4a into master Sep 27, 2017
@kamilogorek kamilogorek deleted the preserve-nonenums branch September 27, 2017 11:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants