Skip to content

Commit b604542

Browse files
author
Julia Huang
committed
Make a copy of configuration being passed in - tests should now be passing
Signed-off-by: Julia Huang <[email protected]>
1 parent 0d56db7 commit b604542

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

lib/bindings/http/binary_0_1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var axios = require("axios");
22

33
function HTTPBinary(configuration){
4-
this.config = configuration;
4+
this.config = JSON.parse(JSON.stringify(configuration));
55

66
this.config["headers"] = {
77
"Content-Type":"application/json; charset=utf-8"

lib/bindings/http/binary_0_2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var axios = require("axios");
22
var empty = require("is-empty");
33

44
function HTTPBinary(configuration){
5-
this.config = configuration;
5+
this.config = JSON.parse(JSON.stringify(configuration));
66

77
this.config["headers"] = {
88
"Content-Type":"application/json; charset=utf-8"

lib/bindings/http/structured_0_1.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var axios = require("axios");
22

33
function HTTPStructured(configuration){
4-
this.config = configuration;
4+
this.config = JSON.parse(JSON.stringify(configuration));
55

66
this.config["headers"] = {
77
"Content-Type":"application/cloudevents+json; charset=utf-8"
@@ -13,6 +13,7 @@ HTTPStructured.prototype.emit = function(cloudevent){
1313
// Create new request object
1414
var _config = JSON.parse(JSON.stringify(this.config));
1515

16+
1617
// Set the cloudevent payload
1718
_config["data"] = cloudevent.format();
1819

lib/bindings/http/structured_0_2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var axios = require("axios");
22

33
function HTTPStructured(configuration){
4-
this.config = configuration;
4+
this.config = JSON.parse(JSON.stringify(configuration));
55

66
this.config["headers"] = {
77
"Content-Type":"application/cloudevents+json; charset=utf-8"

0 commit comments

Comments
 (0)