diff --git a/src/SFML/Network/Http.cpp b/src/SFML/Network/Http.cpp index 5b7f62ca..0381341b 100644 --- a/src/SFML/Network/Http.cpp +++ b/src/SFML/Network/Http.cpp @@ -26,6 +26,7 @@ // Headers //////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -277,19 +278,19 @@ Http::Http(const std::string& host, unsigned short port) //////////////////////////////////////////////////////////// void Http::setHost(const std::string& host, unsigned short port) { - // Detect the protocol used - std::string protocol = toLower(host.substr(0, 8)); - if (protocol.substr(0, 7) == "http://") + // Check the protocol + if (toLower(host.substr(0, 7)) == "http://") { // HTTP protocol m_hostName = host.substr(7); m_port = (port != 0 ? port : 80); } - else if (protocol == "https://") + else if (toLower(host.substr(0, 8)) == "https://") { - // HTTPS protocol - m_hostName = host.substr(8); - m_port = (port != 0 ? port : 443); + // HTTPS protocol -- unsupported (requires encryption and certificates and stuff...) + err() << "HTTPS protocol is not supported by sf::Http" << std::endl; + m_hostName = ""; + m_port = 0; } else {