mirror of
https://github.com/SFML/SFML.git
synced 2024-11-29 06:41:05 +08:00
Made the non-support of HTTPS more explicit
This commit is contained in:
parent
7c4b058c9a
commit
718588ff1d
@ -26,6 +26,7 @@
|
|||||||
// Headers
|
// Headers
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Network/Http.hpp>
|
#include <SFML/Network/Http.hpp>
|
||||||
|
#include <SFML/System/Err.hpp>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
@ -277,19 +278,19 @@ Http::Http(const std::string& host, unsigned short port)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void Http::setHost(const std::string& host, unsigned short port)
|
void Http::setHost(const std::string& host, unsigned short port)
|
||||||
{
|
{
|
||||||
// Detect the protocol used
|
// Check the protocol
|
||||||
std::string protocol = toLower(host.substr(0, 8));
|
if (toLower(host.substr(0, 7)) == "http://")
|
||||||
if (protocol.substr(0, 7) == "http://")
|
|
||||||
{
|
{
|
||||||
// HTTP protocol
|
// HTTP protocol
|
||||||
m_hostName = host.substr(7);
|
m_hostName = host.substr(7);
|
||||||
m_port = (port != 0 ? port : 80);
|
m_port = (port != 0 ? port : 80);
|
||||||
}
|
}
|
||||||
else if (protocol == "https://")
|
else if (toLower(host.substr(0, 8)) == "https://")
|
||||||
{
|
{
|
||||||
// HTTPS protocol
|
// HTTPS protocol -- unsupported (requires encryption and certificates and stuff...)
|
||||||
m_hostName = host.substr(8);
|
err() << "HTTPS protocol is not supported by sf::Http" << std::endl;
|
||||||
m_port = (port != 0 ? port : 443);
|
m_hostName = "";
|
||||||
|
m_port = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user