kuzzle 2.17.1 → 2.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/api/funnel.js CHANGED
@@ -896,6 +896,10 @@ class Funnel {
896
896
  _isOriginAuthorized (origin) {
897
897
  const httpConfig = global.kuzzle.config.http;
898
898
 
899
+ if (! origin) {
900
+ return true;
901
+ }
902
+
899
903
  if (global.kuzzle.config.internal.allowAllOrigins) {
900
904
  return true;
901
905
  }
@@ -258,6 +258,7 @@ class HttpWsProtocol extends Protocol {
258
258
  res.upgrade(
259
259
  {
260
260
  cookie: req.getHeader('cookie'),
261
+ origin: req.getHeader('origin'),
261
262
  },
262
263
  req.getHeader('sec-websocket-key'),
263
264
  req.getHeader('sec-websocket-protocol'),
@@ -268,7 +269,14 @@ class HttpWsProtocol extends Protocol {
268
269
 
269
270
  wsOnOpenHandler (socket) {
270
271
  const ip = Buffer.from(socket.getRemoteAddressAsText()).toString();
271
- const connection = new ClientConnection(this.name, [ip], { cookie: socket.cookie });
272
+ const connection = new ClientConnection(
273
+ this.name,
274
+ [ip],
275
+ {
276
+ cookie: socket.cookie,
277
+ origin: socket.origin
278
+ }
279
+ );
272
280
 
273
281
  this.entryPoint.newConnection(connection);
274
282
  this.connectionBySocket.set(socket, connection);
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuzzle",
3
- "version": "2.17.1",
3
+ "version": "2.17.2",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kuzzle",
3
3
  "author": "The Kuzzle Team <support@kuzzle.io>",
4
- "version": "2.17.1",
4
+ "version": "2.17.2",
5
5
  "description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.",
6
6
  "bin": {
7
7
  "kuzzle": "bin/start-kuzzle-server"