0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd::http: Better handling of unrecognized HTTP status code to reason string.

This commit is contained in:
Jason Volk 2018-02-06 19:28:37 -08:00
parent 24fdfdd9fe
commit cf112ec26e

View file

@ -888,6 +888,16 @@ ircd::http::status(const string_view &str)
ircd::string_view
ircd::http::status(const enum code &code)
try
{
return reason.at(code);
}
catch(const std::out_of_range &e)
{
log::warning
{
"No reason string for HTTP status code %d", int(code)
};
return ""_sv;
}