Skip to content

Commit

Permalink
Added "initialConnectionHeaders" option
Browse files Browse the repository at this point in the history
  • Loading branch information
sgress454 committed Jan 19, 2016
1 parent 4492315 commit 0a251df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sails.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,10 @@
self.multiplex = opts.multiplex;
self.transports = opts.transports;
self.query = opts.query;
// Global headers that will be sent with every io.socket request
self.headers = opts.headers;

// Headers that will be sent with the initial request to /socket.io
self.initialConnectionHeaders = opts.initialConnectionHeaders;
// Set up "eventQueue" to hold event handlers which have not been set on the actual raw socket yet.
self.eventQueue = {};

Expand Down Expand Up @@ -359,7 +361,10 @@
self.url = self.url||io.sails.url;
self.transports = self.transports || io.sails.transports;
self.query = self.query || io.sails.query;
// Global headers that will be sent with every io.socket request
self.headers = self.headers || io.sails.headers;
// Headers that will be sent with the initial request to /socket.io
self.extraHeaders = self.initialConnectionHeaders || io.sails.initialConnectionHeaders || {};

// Ensure URL has no trailing slash
self.url = self.url ? self.url.replace(/(\/)$/, '') : undefined;
Expand Down

0 comments on commit 0a251df

Please sign in to comment.