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:
Julia Huang 2019-06-11 14:22:47 -07:00
parent 0d56db725b
commit b60454234b
4 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,7 @@
var axios = require("axios"); var axios = require("axios");
function HTTPBinary(configuration){ function HTTPBinary(configuration){
this.config = configuration; this.config = JSON.parse(JSON.stringify(configuration));
this.config["headers"] = { this.config["headers"] = {
"Content-Type":"application/json; charset=utf-8" "Content-Type":"application/json; charset=utf-8"

View File

@ -2,7 +2,7 @@ var axios = require("axios");
var empty = require("is-empty"); var empty = require("is-empty");
function HTTPBinary(configuration){ function HTTPBinary(configuration){
this.config = configuration; this.config = JSON.parse(JSON.stringify(configuration));
this.config["headers"] = { this.config["headers"] = {
"Content-Type":"application/json; charset=utf-8" "Content-Type":"application/json; charset=utf-8"

View File

@ -1,7 +1,7 @@
var axios = require("axios"); var axios = require("axios");
function HTTPStructured(configuration){ function HTTPStructured(configuration){
this.config = configuration; this.config = JSON.parse(JSON.stringify(configuration));
this.config["headers"] = { this.config["headers"] = {
"Content-Type":"application/cloudevents+json; charset=utf-8" "Content-Type":"application/cloudevents+json; charset=utf-8"
@ -13,6 +13,7 @@ HTTPStructured.prototype.emit = function(cloudevent){
// Create new request object // Create new request object
var _config = JSON.parse(JSON.stringify(this.config)); var _config = JSON.parse(JSON.stringify(this.config));
// Set the cloudevent payload // Set the cloudevent payload
_config["data"] = cloudevent.format(); _config["data"] = cloudevent.format();

View File

@ -1,7 +1,7 @@
var axios = require("axios"); var axios = require("axios");
function HTTPStructured(configuration){ function HTTPStructured(configuration){
this.config = configuration; this.config = JSON.parse(JSON.stringify(configuration));
this.config["headers"] = { this.config["headers"] = {
"Content-Type":"application/cloudevents+json; charset=utf-8" "Content-Type":"application/cloudevents+json; charset=utf-8"