mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-02 07:45:26 +00:00
Http: Add cloudflare 5XX status code strings
This commit is contained in:
parent
11e94e91a7
commit
0f9f81e9fa
14
src/Http.cpp
14
src/Http.cpp
@ -82,7 +82,7 @@ std::string Http::GET(const std::string& host, int port, const std::string& targ
|
|||||||
if (status) {
|
if (status) {
|
||||||
*status = res.base().result_int();
|
*status = res.base().result_int();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore ec
|
// ignore ec
|
||||||
|
|
||||||
// If we get here then the connection is closed gracefully
|
// If we get here then the connection is closed gracefully
|
||||||
@ -270,12 +270,22 @@ static std::map<size_t, const char*> Map = {
|
|||||||
{ 508, "Loop Detected" },
|
{ 508, "Loop Detected" },
|
||||||
{ 510, "Not Extended" },
|
{ 510, "Not Extended" },
|
||||||
{ 511, "Network Authentication Required" },
|
{ 511, "Network Authentication Required" },
|
||||||
|
// cloudflare status codes
|
||||||
|
{ 520, "(CDN) Web Server Returns An Unknown Error" },
|
||||||
|
{ 521, "(CDN) Web Server Is Down" },
|
||||||
|
{ 522, "(CDN) Connection Timed Out" },
|
||||||
|
{ 523, "(CDN) Origin Is Unreachable" },
|
||||||
|
{ 524, "(CDN) A Timeout Occurred" },
|
||||||
|
{ 525, "(CDN) SSL Handshake Failed" },
|
||||||
|
{ 526, "(CDN) Invalid SSL Certificate" },
|
||||||
|
{ 527, "(CDN) Railgun Listener To Origin Error" },
|
||||||
|
{ 530, "(CDN) 1XXX Internal Error" },
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string Http::Status::ToString(int code) {
|
std::string Http::Status::ToString(int code) {
|
||||||
if (Map.find(code) != Map.end()) {
|
if (Map.find(code) != Map.end()) {
|
||||||
return Map.at(code);
|
return Map.at(code);
|
||||||
} else {
|
} else {
|
||||||
return "Unassigned";
|
return std::to_string(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user