Skip to content

Commit 6dd9a2c

Browse files
authored
Update form-data transitive dep to non-vulnerable version; (#9411)
* Update form-data transitive dep to non-vulnerable version; * Fixing broken tests and code
1 parent 5b848e1 commit 6dd9a2c

File tree

6 files changed

+127
-102
lines changed

6 files changed

+127
-102
lines changed

npm-shrinkwrap.json

Lines changed: 98 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"@electric-sql/pglite": "^0.3.3",
109109
"@electric-sql/pglite-tools": "^0.2.8",
110110
"@google-cloud/cloud-sql-connector": "^1.3.3",
111-
"@google-cloud/pubsub": "^4.5.0",
111+
"@google-cloud/pubsub": "^4.11.0",
112112
"@inquirer/prompts": "^7.4.0",
113113
"@modelcontextprotocol/sdk": "^1.10.2",
114114
"abort-controller": "^3.0.0",
@@ -210,7 +210,7 @@
210210
"@types/mock-fs": "4.13.4",
211211
"@types/multer": "^1.4.3",
212212
"@types/node": "^18.19.1",
213-
"@types/node-fetch": "^2.5.12",
213+
"@types/node-fetch": "^2.6.13",
214214
"@types/pg": "^8.11.2",
215215
"@types/progress": "^2.0.3",
216216
"@types/react": "^18.2.58",

src/apiv2.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,12 @@ export class Client {
365365
}
366366

367367
if (options.signal) {
368-
fetchOptions.signal = options.signal;
368+
const signal = options.signal as any;
369+
signal.reason = "";
370+
signal.throwIfAborted = () => {
371+
throw new FirebaseError("Aborted");
372+
};
373+
fetchOptions.signal = signal;
369374
}
370375

371376
let reqTimeout: NodeJS.Timeout | undefined;
@@ -374,7 +379,12 @@ export class Client {
374379
reqTimeout = setTimeout(() => {
375380
controller.abort();
376381
}, options.timeout);
377-
fetchOptions.signal = controller.signal;
382+
const signal = controller.signal as any;
383+
signal.reason = "";
384+
signal.throwIfAborted = () => {
385+
throw new FirebaseError("Aborted");
386+
};
387+
fetchOptions.signal = signal;
378388
}
379389

380390
if (typeof options.body === "string" || isStream(options.body)) {

src/emulator/auth/operations.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
BlockingFunctionEvents,
3939
} from "./state";
4040
import { MfaEnrollments, Schemas } from "./types";
41+
import { FirebaseError } from "../../error";
4142

4243
/**
4344
* Create a map from IDs to operations handlers suitable for exegesis.
@@ -3130,11 +3131,16 @@ async function fetchBlockingFunction(
31303131
let status: number;
31313132
let text: string;
31323133
try {
3134+
const signal = controller.signal as any;
3135+
signal.reason = "";
3136+
signal.throwIfAborted = () => {
3137+
throw new FirebaseError("Aborted");
3138+
};
31333139
const res = await fetch(url, {
31343140
method: "POST",
31353141
headers: { "Content-Type": "application/json" },
31363142
body: JSON.stringify(reqBody),
3137-
signal: controller.signal,
3143+
signal,
31383144
});
31393145
ok = res.ok;
31403146
status = res.status;

0 commit comments

Comments
 (0)