Cloud function return 404 for /favicon.ico
See original GitHub issueI 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.
I haven’t thought about the solution which also fulfill the original purpose, just to provide my use case.
Ref: https://github.com/GoogleCloudPlatform/functions-framework-nodejs/pull/193
Thank you.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Requesting /favicon.ico URL invokes function, ignores its ...
Unexpected behavior invoker.ts handles the URLs '/favicon.ico' and '/robots.txt' specially, by sending back a 404 response.
Read more >How can I return a 204 rather than 404 for a missing favicon ...
When a favicon.ico file is not found, Nginx returns my define 404 error page, as well as the 404 HTTP status code. However,...
Read more >Guide to the Favicon in Spring Boot | Baeldung
Learn how to customize the favicon in a Spring Boot application. ... A favicon is a small website icon displayed in a browser,...
Read more >has_ipv4() - Azure Data Explorer | Microsoft Learn
In this article. Syntax; Arguments; Returns; Examples. Returns a value indicating whether a specified IPv4 address appears in a text.
Read more >How to Fix Error 404 Not Found on Your WordPress Site - Kinsta
The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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
/favicon.icoThe 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
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.