Commit 3c55076
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 14ce53f commit 3c55076
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 | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
| |||
184 | 183 | | |
185 | 184 | | |
186 | 185 | | |
187 | | - | |
| 186 | + | |
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
| |||
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 216 | + | |
233 | 217 | | |
234 | 218 | | |
235 | 219 | | |
| |||
244 | 228 | | |
245 | 229 | | |
246 | 230 | | |
247 | | - | |
| 231 | + | |
248 | 232 | | |
249 | 233 | | |
250 | 234 | | |
| |||
259 | 243 | | |
260 | 244 | | |
261 | 245 | | |
262 | | - | |
| 246 | + | |
263 | 247 | | |
264 | 248 | | |
265 | 249 | | |
| |||
269 | 253 | | |
270 | 254 | | |
271 | 255 | | |
272 | | - | |
| 256 | + | |
273 | 257 | | |
274 | 258 | | |
275 | 259 | | |
276 | 260 | | |
277 | 261 | | |
278 | 262 | | |
279 | 263 | | |
280 | | - | |
| 264 | + | |
281 | 265 | | |
282 | 266 | | |
283 | 267 | | |
284 | 268 | | |
285 | 269 | | |
286 | | - | |
| 270 | + | |
287 | 271 | | |
288 | 272 | | |
289 | 273 | | |
| |||
0 commit comments