This commit is contained in:
Adam
2025-04-25 12:58:18 +02:00
committed by GitHub
9 changed files with 254 additions and 35 deletions

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/16 17:51:46 by mmoussou #+# #+# */
/* Updated: 2025/04/22 11:52:00 by mmoussou ### ########.fr */
/* Updated: 2025/04/24 14:56:08 by mmoussou ### ########.fr */
/* */
/* ************************************************************************** */
@ -26,6 +26,7 @@ public:
static void setEntries(const std::map<int, std::string>);
static std::map<int, std::string> message;
private:
static std::map<int, std::string> populateMessages();

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/03 17:23:00 by mmoussou #+# #+# */
/* Updated: 2025/04/22 15:07:02 by adjoly ### ########.fr */
/* Updated: 2025/04/24 15:09:52 by mmoussou ### ########.fr */
/* */
/* ************************************************************************** */
@ -19,6 +19,7 @@
#include <requests/HttpIMessage.hpp>
#include <requests/HttpResponse.hpp>
#include <requests/Mime.hpp>
#include <config/default.hpp>

View File

@ -0,0 +1,32 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Mime.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/24 14:53:25 by mmoussou #+# #+# */
/* Updated: 2025/04/24 15:10:32 by mmoussou ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <string>
#include <map>
namespace webserv {
namespace http {
class Mime {
public:
static std::string getType(const std::string &filename);
private:
static std::map<std::string, std::string> initMimeTypes();
static std::map<std::string, std::string> mimeTypes;
};
} // -namespace http
} // -namespace webserv