-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
needs-decisionNot sure if we want to do this yet, also design work neededNot sure if we want to do this yet, also design work needed
Description
Describe the bug
When I try to access favicon.ico
via a browser, the browser prompts to download the file instead of displaying it.
Using curl
, I found that the response has an empty Content-Type
header.
This issue is not limited to favicon.ico
—it happens with any .ico
file.
Some third-party tools may rely on the Content-Type
header to correctly identify and handle icon files. The absence of this header can cause issues or unexpected behavior in those cases.
Reproduction
- Create a minimal project using
npx sv create
. - Download the icon from GitHub for testing.
- Place
favicon.ico
in thestatic
directory. - Add
<link rel="shortcut icon" type="image/x-icon" href="%sveltekit.assets%/favicon.ico" />
toapp.html
. - Run the project and execute
curl -I http://localhost:5173/favicon.ico
. - The response returns an empty
Content-Type
. - Rename
favicon.ico
togithub.ico
. - Repeat steps 4 and 5. The result is the same.
Logs
`curl -I http://localhost:5173/favicon.ico`:
HTTP/1.1 200 OK
access-control-allow-origin: *
Content-Length: 6518
Content-Type:
Last-Modified: Tue, 29 Apr 2025 19:59:46 GMT
ETag: W/"6518-1745956786944"
Cache-Control: no-cache
...
`curl -I https://github.com/favicon.ico`:
HTTP/1.1 200 Connection established
HTTP/2 200
date: Tue, 29 Apr 2025 20:20:34 GMT
content-type: image/x-icon
last-modified: Tue, 29 Apr 2025 19:23:06 GMT
etag: W/"6811271a-1976"
expires: Fri, 27 Apr 2035 20:20:34 GMT
cache-control: max-age=315360000
vary: Accept-Encoding, Accept, X-Requested-With
server: github.com
...
`file favicon.ico`:
favicon.ico: MS Windows icon resource - 2 icons, 16x16, 32 bits/pixel, 32x32, 32 bits/pixel
System Info
System:
OS: Windows 11 10.0.26100
CPU: (16) x64 AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
Memory: 15.50 GB / 31.28 GB
Binaries:
Node: 23.10.0 - C:\Program Files\nodejs\node.EXE
npm: 11.2.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (134.0.3124.68)
npmPackages:
@sveltejs/adapter-auto: ^6.0.0 => 6.0.0
@sveltejs/kit: ^2.20.7 => 2.20.7
@sveltejs/vite-plugin-svelte: ^5.0.3 => 5.0.3
svelte: ^5.28.2 => 5.28.2
vite: ^6.3.3 => 6.3.3
Severity
annoyance
Additional Information
No response
Metadata
Metadata
Assignees
Labels
needs-decisionNot sure if we want to do this yet, also design work neededNot sure if we want to do this yet, also design work needed