1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2025-04-10 11:54:06 +00:00

Fix bad check for port being needed

This commit is contained in:
Heinz Gies 2019-09-12 13:54:09 +02:00 committed by Heinz N. Gies
parent 4b170ad4dc
commit 9a8fc6efdf

View file

@ -238,10 +238,11 @@ impl WebsocketsRequest {
let scheme = uri.scheme_str();
// https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
// requires us to include the port if it's not standard
let needs_port = ((scheme == Some("http") || scheme == Some("ws"))
let needs_port = (((scheme == Some("http") || scheme == Some("ws"))
&& port != Some(80))
|| ((scheme == Some("https") || scheme == Some("wss"))
&& port != Some(443));
&& port != Some(443)))
&& port.is_some();
if needs_port {
self.head.headers.insert(
header::HOST,