diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-12-17 18:16:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-17 18:16:13 -0500 |
commit | 79408fa36bae63eef07c5bbb5c92d40d3193d808 (patch) | |
tree | 2da48b15fae934355cf2dc55d3b391e1bdccc6cc /components/script/dom/testbinding.rs | |
parent | cea55e3892cf271b423806771c34b6ecad35ddde (diff) | |
parent | 19226c5190824828014e7a55fa818798c307cdc9 (diff) | |
download | servo-79408fa36bae63eef07c5bbb5c92d40d3193d808.tar.gz servo-79408fa36bae63eef07c5bbb5c92d40d3193d808.zip |
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()](https://github.com/servo/servo/blob/1974c875a1fb12103a6916c58ed2cbef8c3e32a2/components/net/connector.rs#L116-L119) we do not disable hyper's default [set_host](https://github.com/hyperium/hyper/blob/4b6099c7aa558e6b1fda146ce6179cb0c67858d7/src/client/mod.rs#L1019-L1024) config option, therefore hyper [automatically adds a Host header for non-HTTP/2 connections](https://github.com/hyperium/hyper/blob/4b6099c7aa558e6b1fda146ce6179cb0c67858d7/src/client/mod.rs#L289-L292) based on the [URI](https://github.com/servo/servo/blob/3f663d7ab216a841e6250b5b10ce64d34caff97c/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.
Diffstat (limited to 'components/script/dom/testbinding.rs')
0 files changed, 0 insertions, 0 deletions