From 7427109658591e7ce677a183a664d1f5327f37ea Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Thu, 21 Nov 2024 08:52:37 +0100 Subject: [PATCH] refactor(eio): bump cookie to version 1.0.2 Release notes: https://github.com/jshttp/cookie/releases/tag/v1.0.0 The types are now included in the npm package. The `CookieSerializeOptions` type, which is used in our `ServerOptions` type, has been renamed to `SerializeOptions`, but there are no breaking change. Related: https://github.com/socketio/socket.io/issues/5231 --- package-lock.json | 22 ++++++++-------------- packages/engine.io/lib/server.ts | 4 ++-- packages/engine.io/package.json | 3 +-- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0b8ca918d..c46fc4801b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2823,11 +2823,6 @@ "@types/responselike": "^1.0.0" } }, - "node_modules/@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" - }, "node_modules/@types/cors": { "version": "2.8.17", "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", @@ -5761,11 +5756,11 @@ "dev": true }, "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", + "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", "engines": { - "node": ">= 0.6" + "node": ">=18" } }, "node_modules/cookie-signature": { @@ -15514,12 +15509,11 @@ "version": "6.6.2", "license": "MIT", "dependencies": { - "@types/cookie": "^0.4.1", "@types/cors": "^2.8.12", "@types/node": ">=10.0.0", "accepts": "~1.3.4", "base64id": "2.0.0", - "cookie": "~0.7.2", + "cookie": "~1.0.2", "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", @@ -15530,7 +15524,7 @@ } }, "packages/engine.io-client": { - "version": "6.6.1", + "version": "6.6.2", "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", @@ -15572,7 +15566,7 @@ } }, "packages/socket.io": { - "version": "4.8.0", + "version": "4.8.1", "license": "MIT", "dependencies": { "accepts": "~1.3.4", @@ -15596,7 +15590,7 @@ } }, "packages/socket.io-client": { - "version": "4.8.0", + "version": "4.8.1", "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", diff --git a/packages/engine.io/lib/server.ts b/packages/engine.io/lib/server.ts index 0e3ae063ef..b3c708eed2 100644 --- a/packages/engine.io/lib/server.ts +++ b/packages/engine.io/lib/server.ts @@ -6,13 +6,13 @@ import { EventEmitter } from "events"; import { Socket } from "./socket"; import debugModule from "debug"; import { serialize } from "cookie"; +import type { SerializeOptions } from "cookie"; import { Server as DEFAULT_WS_ENGINE } from "ws"; import type { IncomingMessage, Server as HttpServer, ServerResponse, } from "http"; -import type { CookieSerializeOptions } from "cookie"; import type { CorsOptions, CorsOptionsDelegate } from "cors"; import type { Duplex } from "stream"; import { WebTransport } from "./transports/webtransport"; @@ -123,7 +123,7 @@ export interface ServerOptions { * might be used for sticky-session. Defaults to not sending any cookie. * @default false */ - cookie?: (CookieSerializeOptions & { name: string }) | boolean; + cookie?: (SerializeOptions & { name: string }) | boolean; /** * the options that will be forwarded to the cors module */ diff --git a/packages/engine.io/package.json b/packages/engine.io/package.json index 6c126c6b71..c7b3bb154f 100644 --- a/packages/engine.io/package.json +++ b/packages/engine.io/package.json @@ -31,12 +31,11 @@ ], "license": "MIT", "dependencies": { - "@types/cookie": "^0.4.1", "@types/cors": "^2.8.12", "@types/node": ">=10.0.0", "accepts": "~1.3.4", "base64id": "2.0.0", - "cookie": "~0.7.2", + "cookie": "~1.0.2", "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.2.1",