🔨」 fix: fixed url

This commit is contained in:
2025-04-30 14:54:34 +02:00
parent 57f681ddf0
commit 98955fc131
5 changed files with 48 additions and 15 deletions

View File

@ -6,13 +6,14 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/14 14:14:39 by adjoly #+# #+# */
/* Updated: 2025/04/30 09:37:38 by adjoly ### ########.fr */
/* Updated: 2025/04/30 14:51:39 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <config/default.hpp>
#include <cstdio>
#include <netinet/in.h>
#include <requests/default.hpp>
#include <server/Server.hpp>
@ -30,7 +31,7 @@ class Client {
void parse(void);
void answer(void);
bool requestParsed(void);
bool requestParsed(void);
struct pollfd *getPollfd(void) const { return _pfd; }
@ -43,11 +44,21 @@ class Client {
private:
void _getRequest(std::string);
std::string _sanitizeStr(std::string &str) {
std::string newStr = str;
if (str[str.size() - 1] == '\r') {
newStr.erase(str.size() - 1);
}
return newStr;
}
struct pollfd *_pfd;
struct sockaddr_in _client_addr;
http::ARequest *_request;
// http::Response *_response;
config::Server *_conf;
config::Route *_route;
config::Config *_Gconf;
};