Skip to content

Commit 79bd13d

Browse files
committed
fix background triggers
1 parent e5c119e commit 79bd13d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/emulator/functionsEmulator.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,8 @@ export class FunctionsEmulator implements EmulatorInstance {
222222
const httpsFunctionRoutes = [httpsFunctionRoute, `${httpsFunctionRoute}/*`];
223223

224224
const backgroundHandler: express.RequestHandler = (req, res) => {
225-
const triggerName = req.params.trigger_name;
226-
const region = req.params.region;
225+
const triggerId = req.params.trigger_name;
227226
const projectId = req.params.project_id;
228-
const triggerId = `${region}-${triggerName}`;
229227

230228
const reqBody = (req as RequestWithRawBody).rawBody;
231229
const proto = JSON.parse(reqBody.toString());
@@ -1094,7 +1092,7 @@ export class FunctionsEmulator implements EmulatorInstance {
10941092
// req.url = /:projectId/:region/:trigger_name/*
10951093
const url = new URL(`${req.protocol}://${req.hostname}${req.url}`);
10961094
const path = `${url.pathname}${url.search}`.replace(
1097-
new RegExp(`\/${this.args.projectId}\/[^\/]*\/${triggerId}\/?`),
1095+
new RegExp(`\/${this.args.projectId}\/[^\/]*\/${triggerName}\/?`),
10981096
"/"
10991097
);
11001098

0 commit comments

Comments
 (0)