🏗️」 wip: cgi workinggg

This commit is contained in:
2025-05-27 22:33:04 +02:00
parent 833458e293
commit adde9e0362
25 changed files with 261 additions and 149 deletions

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/14 12:20:06 by adjoly #+# #+# */
/* Updated: 2025/05/03 09:42:35 by adjoly ### ########.fr */
/* Updated: 2025/05/27 19:22:15 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/19 14:59:41 by adjoly #+# #+# */
/* Updated: 2025/05/27 09:37:23 by adjoly ### ########.fr */
/* Updated: 2025/05/27 20:05:20 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -40,6 +40,9 @@ class Route {
bool * getMethods(void) { return _methods; }
bool isCgi(std::string target) {
std::string target_ext = target.substr(target.find('.'));
if (_cgi == not_nullptr)
return false;
for (auto it = prange(_cgi)) {
if (target_ext == *it)
return true;

View File

@ -6,12 +6,13 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/22 12:17:48 by adjoly #+# #+# */
/* Updated: 2025/05/04 12:21:03 by adjoly ### ########.fr */
/* Updated: 2025/05/27 19:46:54 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include "log.hpp"
#include <cstring>
#include <ostream>
#include <sstream>
@ -29,7 +30,7 @@ class URL {
}
int countMatchingSegments(const URL &url) const {
if (_path_segments.size() == 0 || url._path_segments.size() == 0)
if (_path_segments.size() == 0 || url._path_segments.size() == 0)
return 0;
int i = 0;
@ -80,7 +81,7 @@ class URL {
}
}
void _splitPath(const std::string &path,
void _splitPath(const std::string & path,
std::vector<std::string> &segments) const {
std::stringstream ss(path);
std::string segment;

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/19 14:15:51 by adjoly #+# #+# */
/* Updated: 2025/04/22 15:28:31 by adjoly ### ########.fr */
/* Updated: 2025/05/27 19:29:59 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -55,5 +55,7 @@ static inline void *accessValue(const std::string &name, toml::nodeType type,
}
}
extern config::Config *_conf;
}; // namespace config
}; // namespace webserv