mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-05-10 19:48:47 +02:00
banger
This commit is contained in:
@ -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();
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
32
includes/requests/Mime.hpp
Normal file
32
includes/requests/Mime.hpp
Normal 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
|
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/14 14:14:39 by adjoly #+# #+# */
|
||||
/* Updated: 2025/04/23 14:39:16 by mmoussou ### ########.fr */
|
||||
/* Updated: 2025/04/25 12:43:54 by mmoussou ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -23,7 +23,9 @@ namespace server {
|
||||
|
||||
class Client {
|
||||
public:
|
||||
Client(int, sockaddr_in, config::Config *);
|
||||
Client();
|
||||
Client(struct pollfd, sockaddr_in, config::Config *);
|
||||
void parse(struct pollfd, sockaddr_in, config::Config *);
|
||||
virtual ~Client(void);
|
||||
|
||||
void answer(void);
|
||||
@ -31,7 +33,7 @@ class Client {
|
||||
private:
|
||||
void _getRequest(std::string);
|
||||
|
||||
int _fd;
|
||||
struct pollfd _fd;
|
||||
struct sockaddr_in _client_addr;
|
||||
http::IRequest *_request;
|
||||
//http::Response *_response;
|
||||
|
Reference in New Issue
Block a user