-
Notifications
You must be signed in to change notification settings - Fork 158
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
Cloud function return 404 for /favicon.ico #456
Comments
The URL path It's typically recommended that you don't use the literal URL path as an input to your function, at least as an input to another URL. Could your function use a HTTP query param instead, such as |
I believe the alternative implementation should satisfy the use-case. LMK if that doesn't work. Closing as WAI but feel free to comment with requested changes and I can re-open if needed. |
@grant Thank you for explanation.
No, I used cloud function as a reverse proxy without any manipulation on the URL. My intent is that a cloud function should be able dealing with the original request without any extra logic attached on it. |
To follow up here, Cloud Functions is meant to serve and invoke a single function when receiving a HTTP request. The URL path should not be part of the logic of the function. For example, Cloud Functions Gen 1 and Gen 2 have different URL paths. For this use-case of using URL paths within the function, I would consider using express directly with Cloud Run and not using the Functions Framework. |
Hi @grant I am running into this problem. Would it be possible to have some configuration option to disable this very specific behaviour where Google Cloud http triggered functions object to serving The Google Cloud Firebase documentation has examples of using a Google Cloud Function to host an express web app which literally relies on the URL path - which is at odds with your statement:
https://firebase.google.com/docs/hosting/functions#use_a_web_framework |
I use cloud function as a reverse proxy between client(browser) and GCS bucket.
Fetch the GCS bucket object and create readable stream to pipe to client.
When I request
/favicon.ico
it returns 404.There's an existing logic to return 404 for
/favicon.ico|/robots.txt
.Ref: https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/07668f696b29f077d4ba9d0463ea994076cdab50/src/server.ts#L122+L125
I haven't thought about the solution which also fulfill the original purpose, just to provide my use case.
Ref: #193
Thank you.
The text was updated successfully, but these errors were encountered: