Skip to content

Commit

Permalink
Fixup PR #1508: Do case-insensitive comparison of protocol upgrade
Browse files Browse the repository at this point in the history
The original P.R. only fixed one of the overload.
  • Loading branch information
Geod24 committed Jun 4, 2016
1 parent 5e0afff commit 8f9f63d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/vibe/http/client.d
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,8 @@ final class HTTPClientResponse : HTTPResponse {
enforce(statusCode == HTTPStatus.switchingProtocols, "Server did not send a 101 - Switching Protocols response");
string *resNewProto = "Upgrade" in headers;
enforce(resNewProto, "Server did not send an Upgrade header");
enforce(!new_protocol.length || *resNewProto == new_protocol, "Expected Upgrade: " ~ new_protocol ~", received Upgrade: " ~ *resNewProto);
enforce(!new_protocol.length || !icmp(*resNewProto, new_protocol),
"Expected Upgrade: " ~ new_protocol ~", received Upgrade: " ~ *resNewProto);
scope stream = new ConnectionProxyStream(m_client.m_stream, m_client.m_conn);
m_client.m_responding = false;
m_client = null;
Expand Down

0 comments on commit 8f9f63d

Please sign in to comment.