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

/favicon.ico cannot be served by endpoint #4968

Closed
bakkerthehacker opened this issue May 17, 2022 · 0 comments · Fixed by #5046
Closed

/favicon.ico cannot be served by endpoint #4968

bakkerthehacker opened this issue May 17, 2022 · 0 comments · Fixed by #5046
Labels
bug Something isn't working
Milestone

Comments

@bakkerthehacker
Copy link

Describe the bug

Endpoints are not able to process any requests made to /favicon.ico. An endpoint file named /favicon.ico.js does run at all and a 404 is returned instead. While static assets can be served on the /favicon.ico path, the endpoint cannot; this limits /favicon.ico severely for anything more than one file (or some file swapping).

Adjustments can be made with rel="icon" to use a different path, but /favicon.ico is a well known path and should be supported with endpoints.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-rk12yp?file=src/routes/favicon.ico.js
https://github.com/bakkerthehacker/sveltejs-kit-template-default-rk12yp (empty, syncing from stackblitz not working)

/favicon.ico.js and /favicon2.ico.js both have 302 redirects to /todos

localhost:3000/favicon2.ico -> 302 redirects to /todos as expected

localhost:3000/favicon.ico -> 404

Logs

No response

System Info

envinfo doesnt run with `--system` on stackblitz

❯ npx envinfo --binaries --browsers --npmPackages "{svelte,@sveltejs/*,vite}"
success Install finished in 0.399s


  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.10 - /bin/yarn
    npm: 7.17.0 - /bin/npm
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.42 
    @sveltejs/kit: next => 1.0.0-next.330 
    svelte: ^3.46.0 => 3.48.0

Severity

serious, but I can work around it

Additional Information

See this comment on the previous favicon.ico PR: #3559 (comment)

@Rich-Harris Rich-Harris added the bug Something isn't working label May 17, 2022
@Rich-Harris Rich-Harris added this to the 1.0 milestone May 17, 2022
Rich-Harris added a commit that referenced this issue May 24, 2022
* allow /favicon.ico to be a valid route - closes #4968

* Update packages/kit/src/runtime/server/index.js

* Update .changeset/young-flies-camp.md

Co-authored-by: Maurício Kishi <mrkishi@users.noreply.github.com>

Co-authored-by: Maurício Kishi <mrkishi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants