From f1501b0b174bf7b4db2b21e26387a0494f51fbab Mon Sep 17 00:00:00 2001 From: sha512sum Date: Thu, 4 Jul 2024 21:07:38 +0000 Subject: [PATCH] Http/1.1 -> HTTP/1.1 --- include/cserver/server/http/http_request.hpp | 2 +- include/cserver/server/http/http_response.hpp | 2 +- include/cserver/server/http/http_stream.hpp | 2 +- include/cserver/server/server/server.hpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/cserver/server/http/http_request.hpp b/include/cserver/server/http/http_request.hpp index a8e28be..bc1a053 100644 --- a/include/cserver/server/http/http_request.hpp +++ b/include/cserver/server/http/http_request.hpp @@ -14,7 +14,7 @@ struct HttpRequest { std::string body = {}; [[nodiscard]] inline auto ToString() const -> std::string { std::ostringstream stream; - stream << fmt::format("{} {} Http/1.1\r\n", this->method, this->url.path()); + stream << fmt::format("{} {} HTTP/1.1\r\n", this->method, this->url.path()); for(const auto& header : this->headers) { stream << fmt::format("{}: {}\r\n", header.first, header.second); }; diff --git a/include/cserver/server/http/http_response.hpp b/include/cserver/server/http/http_response.hpp index 378f148..a209e66 100644 --- a/include/cserver/server/http/http_response.hpp +++ b/include/cserver/server/http/http_response.hpp @@ -13,7 +13,7 @@ struct HttpResponse { std::string body = {}; [[nodiscard]] inline auto ToString() const -> std::string { std::ostringstream stream; - stream << fmt::format("Http/1.1 {} {}\r\n", this->statusCode, this->statusMessage); + stream << fmt::format("HTTP/1.1 {} {}\r\n", this->statusCode, this->statusMessage); for(const auto& header : this->headers) { stream << fmt::format("{}: {}\r\n", header.first, header.second); }; diff --git a/include/cserver/server/http/http_stream.hpp b/include/cserver/server/http/http_stream.hpp index 095136c..12e19c2 100644 --- a/include/cserver/server/http/http_stream.hpp +++ b/include/cserver/server/http/http_stream.hpp @@ -15,7 +15,7 @@ struct HttpStream { this->socket, boost::asio::buffer(method.data(), method.size()), boost::asio::transfer_all(), boost::asio::use_awaitable); }; inline auto SetStatus(std::string status) -> Task { - status = fmt::format("Http/1.1 {}\r\n", std::move(status)); + status = fmt::format("HTTP/1.1 {}\r\n", std::move(status)); co_await boost::asio::async_write( this->socket, boost::asio::buffer(status.data(), status.size()), boost::asio::transfer_all(), boost::asio::use_awaitable); }; diff --git a/include/cserver/server/server/server.hpp b/include/cserver/server/server/server.hpp index 73dfea9..a5b4579 100644 --- a/include/cserver/server/server/server.hpp +++ b/include/cserver/server/server/server.hpp @@ -72,7 +72,7 @@ struct Server : StopBlocker { ...); }(std::index_sequence_for()); constexpr std::string_view error404 = - "Http/1.1 404 Not Found\r\n" + "HTTP/1.1 404 Not Found\r\n" "Content-Length: 0\r\n" "\r\n"; if(!flag) {