Skip to content

Commit

Permalink
Merge pull request #1511 from Geod24/fixup-pr-1508
Browse files Browse the repository at this point in the history
Fixup PR #1508: Do case-insensitive comparison of protocol upgrade
  • Loading branch information
s-ludwig committed Jun 6, 2016
2 parents 55b2d1d + 8f9f63d commit 1ca5eda
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 1ca5eda

Please sign in to comment.