Make a copy of configuration being passed in - tests should now be passing
Signed-off-by: Julia Huang <julia@playground.global>
This commit is contained in:
parent
0d56db725b
commit
b60454234b
|
@ -1,7 +1,7 @@
|
|||
var axios = require("axios");
|
||||
|
||||
function HTTPBinary(configuration){
|
||||
this.config = configuration;
|
||||
this.config = JSON.parse(JSON.stringify(configuration));
|
||||
|
||||
this.config["headers"] = {
|
||||
"Content-Type":"application/json; charset=utf-8"
|
||||
|
|
|
@ -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));
|
||||
|
||||
this.config["headers"] = {
|
||||
"Content-Type":"application/json; charset=utf-8"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var axios = require("axios");
|
||||
|
||||
function HTTPStructured(configuration){
|
||||
this.config = configuration;
|
||||
this.config = JSON.parse(JSON.stringify(configuration));
|
||||
|
||||
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();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var axios = require("axios");
|
||||
|
||||
function HTTPStructured(configuration){
|
||||
this.config = configuration;
|
||||
this.config = JSON.parse(JSON.stringify(configuration));
|
||||
|
||||
this.config["headers"] = {
|
||||
"Content-Type":"application/cloudevents+json; charset=utf-8"
|
||||
|
|
Loading…
Reference in New Issue