Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from jaredallard/master
Browse files Browse the repository at this point in the history
Allow passing headers to the initial Token fetch in node
  • Loading branch information
jaredallard authored Sep 11, 2018
2 parents 7ecbc88 + e4aa7c7 commit 10fdec0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion clients/server/token-sockjs-ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ Monitor.prototype.sendMessage = function(data, callback){
Monitor.prototype.handleResponse = function(data){
var fn = null;
if(data.rpc && data.uuid)
fn = this._inTransit[data.rpc][data.uuid];
// Throws an error if a response is invalid.
if(this._inTransit[data.rpc]) fn = this._inTransit[data.rpc][data.uuid];
if(fn && typeof fn === "function"){
if(data.error)
fn(data.error);
Expand Down Expand Up @@ -261,6 +262,7 @@ var TokenSocket = function(options, actions){
method: "GET",
protocol: options.protocol,
host: options.host,
headers: options.headers || {},
path: self._tokenPath,
port: options.port
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "token-sockjs-client",
"version": "3.0.2",
"version": "3.1.1",
"description": "Client libraries for Node-Token-Sockjs server",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 10fdec0

Please sign in to comment.