Skip to content
This repository was archived by the owner on Jun 28, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/falcor-http-ws-datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ class FalcorHttpPullWebSocketPushDataSource extends FalcorHttpDataSource {
return this.config.bearerToken;
}

_readFeatureFlags() {
if (this.config.dynamicHeaders) {
return this.config.dynamicHeaders()['X-LANDR-FEATUREFLAGS'];
}

return null;
}

startWS() {
if (this.socket && !this.socket.disconnected) {
try {
Expand All @@ -96,7 +104,11 @@ class FalcorHttpPullWebSocketPushDataSource extends FalcorHttpDataSource {
this.socket = new SocketIoClient(this.pushUrl, this.config);

this.socket.on('connect', () => {
this.socket.emit('authorization', {bearerToken: this._readBearerTokenFromDynamicHeaders(), tabId: this.tabId});
this.socket.emit('authorization', {
bearerToken: this._readBearerTokenFromDynamicHeaders(),
tabId: this.tabId,
featureFlags: this._readFeatureFlags()
});
});

if (this.callback) {
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": "falcor-http-ws-datasource",
"version": "0.2.2",
"version": "0.2.3",
"description": "Falcor HTTP and WebSocket datasource",
"homepage": "",
"author": {
Expand Down