servo/components/net
bors-servo 4307b6e67b Auto merge of #19350 - gterzian:ignore_aborted_responses_in_caching, r=jdm
Ignore aborted responses in caching

<!-- Please describe your changes on the following line: -->
@jdm @KiChjang @Manishearth Follow up on https://github.com/servo/servo/pull/18676 and https://github.com/servo/servo/pull/19274 to ignore aborted responses in caching.

I also found out the cache shouldn't return any response whose body is still in `ResponseBody::Receiving` mode, because that fails the assertion at https://github.com/servo/servo/blob/master/components/net/fetch/methods.rs#L438(we might want to add a channel as pat of the cached response later on to deal with this case). I only found out now because I needed the response from the server to trickle in so that it could be cached and aborted.

I copied the `http-cache.py` server from the wpt folder, and added a 'trickle' option, which is necessary to actually have a failing test with a cached but aborted request, it's now passing.

I also remove one unused import that slippled through previously.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19350)
<!-- Reviewable:end -->
2018-01-23 14:47:16 -06:00
..
fetch handle caching of response with a body of ResponseBody::Receiving 2018-01-13 10:48:36 +08:00
tests Merge net and net_tests 2018-01-20 15:36:09 +01:00
blob_loader.rs Remove unused part of the return value of parse_blob_url(). 2017-01-30 15:16:27 +01:00
Cargo.toml Merge net and net_tests 2018-01-20 15:36:09 +01:00
chrome_loader.rs Removed util. 2016-12-14 18:04:37 -06:00
connector.rs Untry 2017-06-18 13:21:51 +02:00
cookie.rs Implement secure and host cookie prefixes 2017-11-21 19:15:58 -08:00
cookie_storage.rs Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10) 2017-08-15 14:10:44 +02:00
data_loader.rs Replace use of rustc_serialize::base64 by base64 2017-03-26 14:15:31 +02:00
filemanager_thread.rs Prevent an unused import warning on non desktop platforms 2017-12-02 19:29:55 -08:00
hosts.rs Replace parse-hosts crate with 10 lines of code. 2017-11-28 16:19:29 +01:00
hsts.rs Fix indentation errors in servo rust code that tidy now finds. 2017-04-18 14:56:13 -04:00
http_cache.rs handle caching of response with a body of ResponseBody::Receiving 2018-01-13 10:48:36 +08:00
http_loader.rs handle caching of response with a body of ResponseBody::Receiving 2018-01-13 10:48:36 +08:00
image_cache.rs Update WR (removal of RGB8, which isn't supported on some hardware). 2018-01-08 09:02:56 +10:00
lib.rs Replace parse-hosts crate with 10 lines of code. 2017-11-28 16:19:29 +01:00
mime_classifier.rs Fix commonmark Markdown warnings in docs, part 1 2017-10-17 11:24:57 -07:00
resource_thread.rs Remove cancellation map and ResourceId from the net* components 2017-11-21 23:03:16 +01:00
storage_thread.rs Removed util. 2016-12-14 18:04:37 -06:00
subresource_integrity.rs Fix commonmark Markdown warnings in docs, part 1 2017-10-17 11:24:57 -07:00
websocket_loader.rs Upgrade to rustc 1.23.0-nightly (02004ef78 2017-11-08) 2017-11-09 16:56:39 +01:00