[go: nahoru, domu]

Skip to content

Commit

Permalink
fix background triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcnellis committed May 13, 2021
1 parent e5c119e commit a95fe7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/emulator/functionsEmulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,8 @@ export class FunctionsEmulator implements EmulatorInstance {
const httpsFunctionRoutes = [httpsFunctionRoute, `${httpsFunctionRoute}/*`];

const backgroundHandler: express.RequestHandler = (req, res) => {
const triggerName = req.params.trigger_name;
const region = req.params.region;
const triggerId = req.params.trigger_name;
const projectId = req.params.project_id;
const triggerId = `${region}-${triggerName}`;

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

Expand Down
1 change: 0 additions & 1 deletion src/emulator/functionsEmulatorRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
findModuleRoot,
FunctionsRuntimeBundle,
FunctionsRuntimeFeatures,
emulatedFunctionsByRegion,
getEmulatedTriggersFromDefinitions,
FunctionsRuntimeArgs,
HttpConstants,
Expand Down

0 comments on commit a95fe7b

Please sign in to comment.