Commit 76da9fa
authored
Follows-up on #2900
After moving URI decoding into getFile(), sendStatic() was using context.normalizedPath() (which may still contain percent-encoded characters) as the cache key.
Requests for the same file with different encodings (e.g. /foo/%62ar.txt vs /foo/bar.txt) created separate cache entries, wasting slots in the bounded LRU cache.
Use the decoded file path from getFile() as the cache key so that encoding-equivalent paths share a single entry.
As a side effect, getFile() is now called unconditionally at the top of sendStatic(), which simplifies the code.
Previously, it was deferred when includeHidden was true (skipping the dot-segment check), requiring a null guard and a second getFile() call for the localFile computation.
Some portions of this content were created with the assistance of Claude Code.
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent 846da52 commit 76da9fa
1 file changed
Lines changed: 8 additions & 24 deletions
Lines changed: 8 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
| |||
198 | 197 | | |
199 | 198 | | |
200 | 199 | | |
201 | | - | |
| 200 | + | |
202 | 201 | | |
203 | 202 | | |
204 | 203 | | |
| |||
228 | 227 | | |
229 | 228 | | |
230 | 229 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 230 | + | |
247 | 231 | | |
248 | 232 | | |
249 | 233 | | |
| |||
259 | 243 | | |
260 | 244 | | |
261 | 245 | | |
262 | | - | |
| 246 | + | |
263 | 247 | | |
264 | 248 | | |
265 | 249 | | |
| |||
275 | 259 | | |
276 | 260 | | |
277 | 261 | | |
278 | | - | |
| 262 | + | |
279 | 263 | | |
280 | 264 | | |
281 | 265 | | |
| |||
285 | 269 | | |
286 | 270 | | |
287 | 271 | | |
288 | | - | |
| 272 | + | |
289 | 273 | | |
290 | 274 | | |
291 | 275 | | |
292 | 276 | | |
293 | 277 | | |
294 | 278 | | |
295 | 279 | | |
296 | | - | |
| 280 | + | |
297 | 281 | | |
298 | 282 | | |
299 | 283 | | |
300 | 284 | | |
301 | 285 | | |
302 | | - | |
| 286 | + | |
303 | 287 | | |
304 | 288 | | |
305 | 289 | | |
| |||
0 commit comments