Commit fb2221c
committed
Fix if-range handling and its unit tests
The value used for conditional range requests should be updated when the
download is restarted (not *resumed*). The unit tests testing
conditional range requests were broken, using code 206 for the
non-matching responses. This violates the HTTP spec and fools the
resumption logic into thinking the conditional range request was
fulfilled (when it wasn't!).
The test cases were fixed to use code 200 as expected and extended
to ensure the content key is updated across a chain of non-matching
repsonses (which is borderline impossible, but hey it did catch my
eye so why not fix it).1 parent 938ec08 commit fb2221c
File tree
2 files changed
+22
-10
lines changed- src/pip/_internal/network
- tests/unit
2 files changed
+22
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
258 | 266 | | |
259 | 267 | | |
260 | 268 | | |
261 | 269 | | |
262 | 270 | | |
263 | | - | |
| 271 | + | |
264 | 272 | | |
265 | 273 | | |
266 | 274 | | |
267 | | - | |
268 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
269 | 280 | | |
270 | 281 | | |
271 | 282 | | |
| |||
286 | 297 | | |
287 | 298 | | |
288 | 299 | | |
289 | | - | |
| 300 | + | |
290 | 301 | | |
291 | 302 | | |
292 | 303 | | |
293 | 304 | | |
294 | | - | |
| 305 | + | |
295 | 306 | | |
296 | 307 | | |
297 | 308 | | |
| |||
0 commit comments