0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 15:30:52 +01:00

ircd::http: Support HTTP/1.0.

This commit is contained in:
Jason Volk 2019-04-12 08:35:13 -07:00
parent 34e35d97fe
commit 14c32a2075

View file

@ -284,12 +284,18 @@ ircd::http::request::head::head(parse::capstan &pc,
} }
,headers{[this, &pc, &c] ,headers{[this, &pc, &c]
{ {
if(this->version != "HTTP/1.1") const bool version_compatible
{
this->version == "HTTP/1.0" ||
this->version == "HTTP/1.1"
};
if(!version_compatible)
throw error throw error
{ {
HTTP_VERSION_NOT_SUPPORTED, fmt::snstringf HTTP_VERSION_NOT_SUPPORTED, fmt::snstringf
{ {
128, "Sorry, I don't speak '%s' only HTTP/1.1 here.", 128, "Sorry, no speak '%s'. Try HTTP/1.1 here.",
this->version this->version
} }
}; };