Skip to content

Commit

Permalink
fix(http_server): in http2 host is not passed in headers (#866)
Browse files Browse the repository at this point in the history
  • Loading branch information
polachok authored Sep 1, 2022
1 parent 49f260e commit 5a2f6f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions http-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ impl<L: Logger> ServiceData<L> {

let host = match http_helpers::read_header_value(request.headers(), "host") {
Some(origin) => origin,
None if request.version() == hyper::Version::HTTP_2 => match request.uri().host() {
Some(origin) => origin,
None => return response::malformed(),
},
None => return response::malformed(),
};
let maybe_origin = http_helpers::read_header_value(request.headers(), "origin");
Expand Down

0 comments on commit 5a2f6f1

Please sign in to comment.