headers are now always lower case

This commit is contained in:
Jorijn van der Graaf 2025-11-02 16:04:32 +01:00
commit 64739c39d8
2 changed files with 50 additions and 47 deletions

View file

@ -62,7 +62,7 @@ namespace Crafter {
return std::format("{} {} HTTP/1.1\r\nConnection: keep-alive\r\nAccept-Encoding: identity\r\nContent-Length: 0\r\nHost: {}\r\n\r\n", method, route, host);
}
export constexpr std::string CreateRequestHTTP(std::string method, std::string route, std::unordered_map<std::string, std::string> headers, std::string host) {
export constexpr std::string CreateRequestHTTP(std::string method, std::string route, std::string host, std::unordered_map<std::string, std::string> headers) {
std::string headersString;
for (auto const& [key, val] : headers) {
headersString+=std::format("{}: {}\r\n", key, val);