servo/components/net
bors-servo 5a5a76cc5d Auto merge of #13058 - malisas:malisa-responseAPI, r=Manishearth,jdm
Response API

<!-- Please describe your changes on the following line: -->
This PR adds the [dom::Response](https://fetch.spec.whatwg.org/#response-class) implementation and addresses #11896.

The relevant passing tests` expectations have been updated.

In order to allow non-UTF-8-encoded status messages, `net_traits::response::Response`'s `raw_status` field has been changed from type [`Option<RawStatus>`](https://doc.servo.org/hyper/http/struct.RawStatus.html) to type `Option<(u16, Vec<u8>)>`. As a result, a few other files which rely on the `raw_status` field were affected and updated.

TODOs:
- The `body` and `trailer` methods. Relies on implementation of `ReadableStream` and `Promise`s.
- Similarly, replace the dummy constructor `_body: Option<USVString>` argument with `body: ResponseBodyInit`.
- Currently, whenever `r's response's header list` or `r's Headers object` are mentioned, I always modify the `headers_reflector` field (of type dom::Headers, or `r's Headers object`) and not the corresponding hyper::Headers list in the net_traits::Response field. A completely accurate interpretation of the spec might consider making both of these lists the same thing via a reference. [Discussion](https://github.com/whatwg/fetch/issues/358) was [had](https://github.com/servo/servo/pull/12884).

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

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

<!-- 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/13058)
<!-- Reviewable:end -->
2016-09-08 18:58:05 -05:00
..
fetch dom::Response implementation 2016-09-06 19:58:32 -07:00
about_loader.rs dom::Response implementation 2016-09-06 19:58:32 -07:00
blob_loader.rs dom::Response implementation 2016-09-06 19:58:32 -07:00
bluetooth_thread.rs WebBluetooth Android support 2016-09-06 12:48:04 +02:00
Cargo.toml Burn SelectedFileId in fire 2016-08-22 10:05:01 +02:00
chrome_loader.rs Use Result instead of panicking when the resource dir can't be found 2016-07-21 12:07:25 +05:30
connector.rs Use Result instead of panicking when the resource dir can't be found 2016-07-21 12:07:25 +05:30
content_blocker.rs Read the content blocking rules and make them available to the HTTP loader. 2016-05-30 10:54:52 +02:00
cookie.rs Add mach command to update public domain list and use a HashSet instead of a Vec to lookup public domains 2016-06-09 09:14:01 +02:00
cookie_storage.rs Use common cookie struct add cookie webdriver cmds 2016-06-25 22:24:35 +00:00
data_loader.rs Rename MIMEClassifier to match Rust acronym naming conventions. 2016-07-02 17:12:46 -04:00
file_loader.rs Integrate service worker manager thread 2016-07-16 23:29:44 +05:30
filemanager_thread.rs Burn SelectedFileId in fire 2016-08-22 10:05:01 +02:00
hsts.rs Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
http_loader.rs dom::Response implementation 2016-09-06 19:58:32 -07:00
image_cache_thread.rs Use Result instead of panicking when the resource dir can't be found 2016-07-21 12:07:25 +05:30
lib.rs Update serde to 0.8 (fixes #12659) 2016-08-12 18:37:27 +02:00
mime_classifier.rs Rename MIMEClassifier to match Rust acronym naming conventions. 2016-07-02 17:12:46 -04:00
pub_domains.rs Add mach command to update public domain list and use a HashSet instead of a Vec to lookup public domains 2016-06-09 09:14:01 +02:00
resource_thread.rs Update serde to 0.8 (fixes #12659) 2016-08-12 18:37:27 +02:00
storage_thread.rs Remove use of util::opts from storage_thread 2016-07-27 10:25:48 +02:00
websocket_loader.rs Test fixes: 2016-06-10 20:53:36 +05:30