Skip to content

Make a copy of configuration being passed in #14

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

Closed
wants to merge 1 commit into from
Closed

Make a copy of configuration being passed in #14

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 11, 2019

Tests currently do not pass because the same config object is being used between the two bindings and the Content Type is being overridden. Changing the constructor to copy the config fixes this problem.

@@ -1,7 +1,7 @@
var axios = require("axios");

function HTTPBinary(configuration){
this.config = configuration;
this.config = JSON.parse(JSON.stringify(configuration));
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check out the line #14. I suggest you remove this copy because it is useless.

Copy link
Author

Choose a reason for hiding this comment

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

I saw line #14. I don't think it's useless because the config object is being changed in line 6/7. That's what is causing npm test to fail...

Copy link
Author

Choose a reason for hiding this comment

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

It might make more sense if you look at my other pull request first. #15

@@ -2,7 +2,7 @@ var axios = require("axios");
var empty = require("is-empty");

function HTTPBinary(configuration){
this.config = configuration;
this.config = JSON.parse(JSON.stringify(configuration));
Copy link
Contributor

Choose a reason for hiding this comment

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

Check out the line #15. The same way.

@@ -1,7 +1,7 @@
var axios = require("axios");

function HTTPStructured(configuration){
this.config = configuration;
this.config = JSON.parse(JSON.stringify(configuration));
Copy link
Contributor

Choose a reason for hiding this comment

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

Check out the line #14. Same suggestion.

@@ -1,7 +1,7 @@
var axios = require("axios");

function HTTPStructured(configuration){
this.config = configuration;
this.config = JSON.parse(JSON.stringify(configuration));
Copy link
Contributor

Choose a reason for hiding this comment

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

Check out the line #14.

@fabiojose
Copy link
Contributor

@playground-julia I've made some suggestions. Looking forward to your comments.

@ghost
Copy link
Author

ghost commented Jun 11, 2019

Putting these changes in PR #15 and closing this. This was also not signed.

This pull request was closed.
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.

1 participant