This repository was archived by the owner on Feb 13, 2026. It is now read-only.
Commit 06b282f
authored
frontend: bypass auth middleware for favicon and icon assets in root (#3240)
Updated the `ServeHTTP` function in the `assetHandler` to add caching
headers for `.ico`, `.svg`, and `.webp` files, serving these files with
a `Cache-Control` header set to cache for one day.
This change bypasses the authentication middleware for favicon and icon
assets in the root directory. The bypass is limited to image assets in
the root path to maintain security.
Key changes:
- Added early path check for image file extensions (.ico, .svg, .webp)
- Added security check to only serve files from root directory
- Set Cache-Control header to cache assets for 24 hours
- Serve files directly without going through auth middleware1 parent e02a57c commit 06b282f
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
63 | 77 | | |
64 | 78 | | |
65 | 79 | | |
| |||
0 commit comments