From 46110eb404146cc2920e7f21a14cd6e88e2d88e1 Mon Sep 17 00:00:00 2001 From: Matt Poegel Date: Thu, 22 Aug 2024 03:05:27 +0000 Subject: [PATCH] support http static css files --- http/fwoop_httpclient.cpp | 1 + http/fwoop_httpresponse.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/http/fwoop_httpclient.cpp b/http/fwoop_httpclient.cpp index 4e48412..aebead4 100644 --- a/http/fwoop_httpclient.cpp +++ b/http/fwoop_httpclient.cpp @@ -57,6 +57,7 @@ std::error_code HttpClient::makeReqest(const HttpRequest &request, std::shared_p Log::Error("hostname ", d_host, " not found"); return std::error_code(static_cast(HttpErrc::HostNotFound), HttpClientError); } + Log::Debug("connecting to IP: ", record->IP()); if (inet_pton(AF_INET, record->IP().c_str(), &serv_addr.sin_addr) <= 0) { Log::Error("invalid address or address not supported"); reset(); diff --git a/http/fwoop_httpresponse.cpp b/http/fwoop_httpresponse.cpp index 533ab2d..c47ec41 100644 --- a/http/fwoop_httpresponse.cpp +++ b/http/fwoop_httpresponse.cpp @@ -16,6 +16,8 @@ void HttpResponse::streamFile(const std::string &fileName) auto ext = FileReader::getExtension(d_fileName); if (ext == "html") { d_headers.push_back({HttpHeader::ContentType, "text/html"}); + } else if (ext == "css") { + d_headers.push_back({HttpHeader::ContentType, "text/css"}); } else { d_headers.push_back({HttpHeader::ContentType, "text/plain"}); }