servo/components/net
bors-servo 79408fa36b
Auto merge of #25294 - Darkspirit:h2, r=jdm
Let hyper automatically set the host header if needed

Google's gws web server did not expect to receive an unneeded Host header via HTTP/2, therefore it responded with 400 Bad Request over a working HTTP/2 connection.

https://tools.ietf.org/html/rfc7540#page-55
> Clients that generate HTTP/2 requests directly SHOULD use the ":authority" pseudo-header field instead of the Host header field.

It's hyper's job to take care of this for the HTTP/1 case, therefore we can remove old code.
When calling [Client::builder()](1974c875a1/components/net/connector.rs (L116-L119)) we do not disable hyper's default [set_host](4b6099c7aa/src/client/mod.rs (L1019-L1024)) config option, therefore hyper [automatically adds a Host header for non-HTTP/2 connections](4b6099c7aa/src/client/mod.rs (L289-L292))  based on the [URI](3f663d7ab2/components/net/http_loader.rs (L418-L421)).

r? @jdm

---
<!-- 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
- [x] These changes fix #25286.
2019-12-17 18:16:13 -05:00
..
fetch Now just one is_cors_safelisted_request_header, with closer spec alignment 2019-12-16 09:07:02 -05:00
tests Let hyper automatically add a host header for HTTP/1 2019-12-16 14:01:18 +01:00
Cargo.toml Auto merge of #24875 - jdm:wr-no-ipc, r=asajeffrey 2019-11-27 20:48:13 -05:00
connector.rs Add ALPN and signature algorithms to OpenSSL config 2019-11-30 05:18:00 +01:00
cookie.rs Add webdriver deletecookies function 2019-04-19 13:15:50 +05:30
cookie_storage.rs Add webdriver deletecookies function 2019-04-19 13:15:50 +05:30
data_loader.rs Fix #2909 as far as WPT is concerned, not full data-url class integration 2019-11-26 09:49:30 -05:00
decoder.rs Fix some new warnings 2019-06-22 14:59:09 +02:00
filemanager_thread.rs Deduplicate idna, log, mime, mime_guess, percent-encoding, unicase, url, ws 2019-08-19 20:09:20 +02:00
hosts.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
hsts.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
http_cache.rs http-cache: wait on pending stores 2019-10-08 17:58:20 +08:00
http_loader.rs Auto merge of #25294 - Darkspirit:h2, r=jdm 2019-12-17 18:16:13 -05:00
image_cache.rs Use non-IPC webrender API over explicit IPC channels. 2019-11-27 20:47:53 -05:00
lib.rs #8539 Config preferences backend restructure 2019-03-20 15:01:26 +00:00
mime_classifier.rs Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
resource_thread.rs Let hyper automatically add a host header for HTTP/1 2019-12-16 14:01:18 +01:00
storage_thread.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
subresource_integrity.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
websocket_loader.rs Add ALPN and signature algorithms to OpenSSL config 2019-11-30 05:18:00 +01:00