From 94ed73a60e4c0fb45655d7043902a4a8276f9940 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 23 Mar 2019 03:12:28 -0700 Subject: [PATCH] ircd::http: Remove gratuitous error constructor; fix 505 response content. --- include/ircd/http.h | 15 --------------- ircd/http.cc | 7 +++++-- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/include/ircd/http.h b/include/ircd/http.h index 12c57cf3a..7dfa718ff 100644 --- a/include/ircd/http.h +++ b/include/ircd/http.h @@ -52,7 +52,6 @@ struct ircd::http::error error() = default; error(const http::code &, std::string content = {}, std::string headers = {}); error(const http::code &, std::string content, const vector_view &); - template error(const http::code &, const string_view &fmt, args&&...); }; /// Represents a single \r\n delimited line used in HTTP. @@ -364,17 +363,3 @@ const { return lex_cast(at(key, idx)); } - -template -ircd::http::error::error(const http::code &code, - const string_view &fmt, - args&&... a) -:http::error -{ - code, fmt::snstringf - { - BUFSIZE, fmt, std::forward(a)... - } -} -{} diff --git a/ircd/http.cc b/ircd/http.cc index 18446fbdf..c8b896fe4 100644 --- a/ircd/http.cc +++ b/ircd/http.cc @@ -287,8 +287,11 @@ ircd::http::request::head::head(parse::capstan &pc, if(this->version != "HTTP/1.1") throw error { - HTTP_VERSION_NOT_SUPPORTED, "Sorry, I don't speak '%s' only HTTP/1.1 here."_sv, - string_view{this->version} + HTTP_VERSION_NOT_SUPPORTED, fmt::snstringf + { + 128, "Sorry, I don't speak '%s' only HTTP/1.1 here.", + this->version + } }; return http::headers{pc, [this, &c](const auto &h)