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

Emulator does not invoke function when making a HTTP pre-flight OPTIONS request (firebase-tools v10) #4294

Closed
jowo-io opened this issue Mar 12, 2022 · 2 comments · Fixed by #4295
Assignees

Comments

@jowo-io
Copy link

jowo-io commented Mar 12, 2022

Loving the features the firebase team is releasing - so cool being able to run my entire firebase stack locally through the emulator.

I was pulling my hair out today attempting to debug a CORS issues. When invoking a function I was getting CORS issues and eventually tracked the root of the issue down to the pre-flight request not returning the access-control-allow-credentials header.

I realised that the function was no longer being invoked when requested with the OPTIONS http status when running the firebase-tool@v10 emulator. I'll attach a few screenshots below of requests made with postman

v9

"firebase-tools": "^9.23.3",

Foobar

When pinging the URL http://localhost:7000/foobar

Screenshot (277)

The emulator returns a generic set of headers

Function

When pinging the URL http://localhost:7000/<my-project>/us-central1/auth-login (the actual emulator function URL)

Screenshot (276)

The emulator did invoke my function, and ran my code, then returns a custom header that I've configured it to return.

v10

"firebase-tools": "^10.2.2",

Foobar

When pinging the URL http://localhost:7000/foobar

Screenshot (274)

The emulator returns a generic set of headers

Function

When pinging the URL http://localhost:7000/<my-project>/us-central1/auth-login (the actual emulator function URL)

Screenshot (275)

The emulator does not invoke my function, instead it returns a generic set of headers

@jowo-io
Copy link
Author

jowo-io commented Mar 12, 2022

just realised I may have posted this in the wrong place?

@yuchenshi yuchenshi transferred this issue from firebase/firebase-tools-ui Mar 14, 2022
@joehan joehan self-assigned this Mar 14, 2022
@joehan
Copy link
Contributor

joehan commented Mar 14, 2022

@jowo-io Thanks for reporting this. I think I broke this recently while adding support for a new emulator UI feature. I'll do some testing this afternoon and hopefully have a fix out soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants