Commit dd499e1
committed
feat: add a "revalidation hook" to
This commit adds a `with_revalidation_hook` method to `Cache` that
allows users to control the headers sent as part of a cache revalidation
request.
This is needed for Azure Storage where they inexplicably use conditional
request headers like `If-None-Match` as part of the authentication
signature, which breaks transparent caching middleware like this one.
With the hook, a new `Authorization` header can be calculated and then
overridden for the request to revalidate.Cache to allow for recalculation of authentication.1 parent 235faef commit dd499e1
2 files changed
+74
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
155 | 175 | | |
156 | 176 | | |
157 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
294 | 309 | | |
295 | 310 | | |
296 | 311 | | |
297 | 312 | | |
298 | 313 | | |
299 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
300 | 319 | | |
301 | 320 | | |
302 | 321 | | |
| |||
314 | 333 | | |
315 | 334 | | |
316 | 335 | | |
| 336 | + | |
317 | 337 | | |
318 | 338 | | |
319 | 339 | | |
320 | 340 | | |
321 | 341 | | |
322 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
323 | 368 | | |
324 | 369 | | |
325 | 370 | | |
| |||
469 | 514 | | |
470 | 515 | | |
471 | 516 | | |
472 | | - | |
| 517 | + | |
473 | 518 | | |
474 | 519 | | |
475 | 520 | | |
| |||
511 | 556 | | |
512 | 557 | | |
513 | 558 | | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
514 | 566 | | |
515 | 567 | | |
516 | 568 | | |
| |||
0 commit comments