Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions emulator matches too many URLs #1773

Closed
samtstern opened this issue Nov 6, 2019 · 0 comments · Fixed by #1780
Closed

Functions emulator matches too many URLs #1773

samtstern opened this issue Nov 6, 2019 · 0 comments · Fixed by #1780

Comments

@samtstern
Copy link
Member

@samtstern samtstern commented Nov 6, 2019

[REQUIRED] Environment info

firebase-tools: 7.6.1

Platform: all

[REQUIRED] Test case

See #1771 for original report

[REQUIRED] Steps to reproduce

Ping localhost:5001/foo/bar/baz

[REQUIRED] Expected behavior

Ignored because that's not a Firebase-relevant URL.

[REQUIRED] Actual behavior

This line in functionsEmulator.ts:

const httpsFunctionRoute = `/:project_id/:region/:trigger_name`;

Matches basically any three-segment URL. So the above would try to run function baz in region bar in project foo.

We should do a few things:

  1. When initializing the functions emulator, hard-code the projectId into this path.
  2. When running the HTTPs handler, make sure that region is one of a valid set before trying to execute a function, otherwise send a 4xx error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.