-
Notifications
You must be signed in to change notification settings - Fork 70
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check out the line #15. The same way. |
||
|
||
this.config["headers"] = { | ||
"Content-Type":"application/cloudevents+json; charset=utf-8" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
var axios = require("axios"); | ||
|
||
function HTTPStructured(configuration){ | ||
this.config = configuration; | ||
this.config = JSON.parse(JSON.stringify(configuration)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check out the line #14. Same suggestion. |
||
|
||
this.config["headers"] = { | ||
"Content-Type":"application/cloudevents+json; charset=utf-8" | ||
|
@@ -13,6 +13,7 @@ HTTPStructured.prototype.emit = function(cloudevent){ | |
// Create new request object | ||
var _config = JSON.parse(JSON.stringify(this.config)); | ||
|
||
|
||
// Set the cloudevent payload | ||
_config["data"] = cloudevent.format(); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
var axios = require("axios"); | ||
|
||
function HTTPStructured(configuration){ | ||
this.config = configuration; | ||
this.config = JSON.parse(JSON.stringify(configuration)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check out the line #14. |
||
|
||
this.config["headers"] = { | ||
"Content-Type":"application/cloudevents+json; charset=utf-8" | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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