src/api2/admin/datastore/h2upload.rs: test if version < 2

We can only upgrade http 1.x connections.
This commit is contained in:
Dietmar Maurer 2019-05-06 10:29:34 +02:00
parent 45cdce069e
commit 96e95fc179

View File

@ -39,6 +39,10 @@ fn upgrade_h2upload(
bail!("invalid protocol name");
}
if parts.version >= http::version::Version::HTTP_2 {
bail!("unexpected http version '{:?}' (expected version < 2)", parts.version);
}
rt::spawn(
req_body
.on_upgrade()