」 feat: working server_name

This commit is contained in:
2025-05-09 11:53:44 +02:00
parent b3e167e5d1
commit c0258855e5
6 changed files with 56 additions and 35 deletions

View File

@ -6,10 +6,11 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/11 23:34:45 by mmoussou #+# #+# */
/* Updated: 2025/04/30 09:48:31 by adjoly ### ########.fr */
/* Updated: 2025/05/09 11:20:43 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "requests/IMessage.hpp"
#include <requests/default.hpp>
using namespace webserv::http;
@ -18,6 +19,15 @@ std::map<std::string, std::string> IMessage::getHeaders(void) const {
return (this->_headers);
}
std::string IMessage::getHeader(const std::string key) const {
std::string str;
auto it = _headers.find(key);
if (it == _headers.end())
return "";
str = it->second;
return str;
}
std::string IMessage::getBody(void) const { return (this->_body); }
void IMessage::setHeaders(std::map<std::string, std::string> const headers) {