Commit ebac34b
committed
fix(spa-fallback): always return index.html after refresh & 304 cache hit
* Strip 'If-None-Match' / 'If-Modified-Since' before proxying the request to index.html, forcing the asset-server to answer with 200 + body.
* Treat 304 responses as success so the fallback still works when the file is cached.
* Ensure Content-Type: text/html; charset=utf-8 is set to prevent MIME errors in the browser.
* Leave static asset requests (.js, .css, images, etc.) untouched.
This guarantees deep-link routes keep working after multiple page reloads and removes the 'Not Found / text/plain MIME type' error seen on the second refresh.1 parent 9fdd02e commit ebac34b
1 file changed
+27
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
204 | 203 | | |
205 | 204 | | |
206 | | - | |
207 | | - | |
208 | 205 | | |
209 | | - | |
210 | | - | |
211 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
212 | 230 | | |
213 | 231 | | |
214 | 232 | | |
| |||
0 commit comments