mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-06-25 09:33:36 +02:00
「🏗️」 wip: cgi workinggg
This commit is contained in:
@ -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 */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user