mirror of
https://github.com/actix/actix-web.git
synced 2024-12-22 16:16:40 +00:00
fix protocol order for rustls acceptor
This commit is contained in:
parent
85acc3f8df
commit
57f991280c
1 changed files with 3 additions and 4 deletions
|
@ -25,13 +25,12 @@ impl RustlsAcceptor {
|
||||||
/// Create `OpensslAcceptor` with custom server flags.
|
/// Create `OpensslAcceptor` with custom server flags.
|
||||||
pub fn with_flags(mut config: ServerConfig, flags: ServerFlags) -> Self {
|
pub fn with_flags(mut config: ServerConfig, flags: ServerFlags) -> Self {
|
||||||
let mut protos = Vec::new();
|
let mut protos = Vec::new();
|
||||||
if flags.contains(ServerFlags::HTTP1) {
|
|
||||||
protos.push("http/1.1".to_string());
|
|
||||||
}
|
|
||||||
if flags.contains(ServerFlags::HTTP2) {
|
if flags.contains(ServerFlags::HTTP2) {
|
||||||
protos.push("h2".to_string());
|
protos.push("h2".to_string());
|
||||||
}
|
}
|
||||||
|
if flags.contains(ServerFlags::HTTP1) {
|
||||||
|
protos.push("http/1.1".to_string());
|
||||||
|
}
|
||||||
if !protos.is_empty() {
|
if !protos.is_empty() {
|
||||||
config.set_protocols(&protos);
|
config.set_protocols(&protos);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue