Skip to content

Commit

Permalink
Fix copy by reference issue
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkingserious committed Jun 8, 2016
1 parent 223b7bf commit d8ecca7
Show file tree
Hide file tree
Showing 2 changed files with 328 additions and 328 deletions.
6 changes: 3 additions & 3 deletions lib/sendgrid.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use strict";
var package_json = require('./../package.json');
var emptyRequest = require('sendgrid-rest').emptyRequest
var emptyRequest = JSON.parse(JSON.stringify(require('sendgrid-rest').emptyRequest));

// SendGrid allows for quick and easy access to the v3 Web API
function SendGrid (apiKey, host, globalHeaders) {
var Client = require('sendgrid-rest').Client
var globalRequest = require('sendgrid-rest').emptyRequest
var globalRequest = JSON.parse(JSON.stringify(require('sendgrid-rest').emptyRequest));
globalRequest.host = host || "api.sendgrid.com";
globalRequest.headers['Content-Type'] = 'application/json'
globalRequest.headers['Authorization'] = 'Bearer '.concat(apiKey)
Expand All @@ -20,7 +20,7 @@ function SendGrid (apiKey, host, globalHeaders) {
var client = new Client(globalRequest)

this.emptyRequest = function () {
return require('sendgrid-rest').emptyRequest
return JSON.parse(JSON.stringify(require('sendgrid-rest').emptyRequest));
}

// Interact with the API with this function
Expand Down

0 comments on commit d8ecca7

Please sign in to comment.