Commit 370cfd9
Matteo Mazza
fix(HttpCache): align mergedHeadersLookup separator with HttpCacheEntry.varyKeys()
mergedHeadersLookup() joined multi-value headers with ";" while varyKeys()
joined them with ",", so findResponse() always discarded cached entries for
requests with repeated header values (e.g. when ContentNegotiation appends a
second Accept value).
Extract joinHeaderValues() (RFC 7230 §3.2.2 comma separator) and use it in
both places so the stored and looked-up strings are always identical.1 parent e0cf313 commit 370cfd9
3 files changed
Lines changed: 17 additions & 18 deletions
File tree
- ktor-client/ktor-client-core/common
- src/io/ktor/client/plugins/cache
- test
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
397 | | - | |
| 396 | + | |
| 397 | + | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
60 | | - | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
Lines changed: 11 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
| 203 | + | |
203 | 204 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
212 | 208 | | |
213 | 209 | | |
214 | | - | |
| 210 | + | |
215 | 211 | | |
216 | 212 | | |
217 | 213 | | |
218 | 214 | | |
219 | 215 | | |
220 | | - | |
221 | | - | |
| 216 | + | |
| 217 | + | |
222 | 218 | | |
223 | 219 | | |
224 | | - | |
225 | | - | |
226 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
227 | 223 | | |
228 | 224 | | |
229 | 225 | | |
| |||
0 commit comments