trying to setup tester weird stufffff
This commit is contained in:
parent
0c081bbb2c
commit
0d57ce4f27
BIN
cgi_tester
Normal file
BIN
cgi_tester
Normal file
Binary file not shown.
@ -123,4 +123,39 @@ server {
|
|||||||
|
|
||||||
cgi_enabled yes;
|
cgi_enabled yes;
|
||||||
cgi_ext .php /usr/bin/php-cgi;
|
cgi_ext .php /usr/bin/php-cgi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 8083;
|
||||||
|
host 127.0.0.1;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
root ./htdocs/YoupiBanane/;
|
||||||
|
index index.html index2.htm;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root ./htdocs/YoupiBanane/;
|
||||||
|
index index.html;
|
||||||
|
allowed_methods GET;
|
||||||
|
|
||||||
|
}
|
||||||
|
location /put_test {
|
||||||
|
root ./htdocs/YoupiBanane/;
|
||||||
|
allowed_methods PUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /post_body {
|
||||||
|
root ./htdocs/YoupiBanane/;
|
||||||
|
client_max_body_size 100;
|
||||||
|
allowed_methods POST;
|
||||||
|
|
||||||
|
}
|
||||||
|
location /directory {
|
||||||
|
root ./htdocs/YoupiBanane/;
|
||||||
|
index youpi.bad_extension
|
||||||
|
allowed_methods GET;
|
||||||
|
}
|
||||||
|
|
||||||
|
cgi_enabled yes;
|
||||||
|
cgi_ext .bla ./ubuntu_cgi_tester
|
||||||
|
}
|
||||||
0
htdocs/YoupiBanane/Yeah/not_happy.bad_extension
Normal file
0
htdocs/YoupiBanane/Yeah/not_happy.bad_extension
Normal file
0
htdocs/YoupiBanane/nop/youpi.bad_extension
Normal file
0
htdocs/YoupiBanane/nop/youpi.bad_extension
Normal file
0
htdocs/YoupiBanane/nop/youpi.pouic
Normal file
0
htdocs/YoupiBanane/nop/youpi.pouic
Normal file
0
htdocs/YoupiBanane/youpi.bad_extension
Normal file
0
htdocs/YoupiBanane/youpi.bad_extension
Normal file
0
htdocs/YoupiBanane/youpi.bla
Normal file
0
htdocs/YoupiBanane/youpi.bla
Normal file
BIN
ubuntu_cgi_tester
Executable file
BIN
ubuntu_cgi_tester
Executable file
Binary file not shown.
BIN
ubuntu_tester
Executable file
BIN
ubuntu_tester
Executable file
Binary file not shown.
@ -37,7 +37,8 @@ ConfigValidator::ConfigValidator(const GlobalConfig *config) : engine_(std::make
|
|||||||
|
|
||||||
/*Location Directive Rules*/
|
/*Location Directive Rules*/
|
||||||
engine_->addLocationRule("allowed_methods",
|
engine_->addLocationRule("allowed_methods",
|
||||||
std::make_unique<AllowedValuesRule>(std::vector<std::string>{"GET", "POST", "DELETE"}));
|
std::make_unique<AllowedValuesRule>(std::vector<std::string>{"GET", "POST", "DELETE", "PUT"},
|
||||||
|
true));
|
||||||
engine_->addLocationRule("root", std::make_unique<FolderExistsRule>(true));
|
engine_->addLocationRule("root", std::make_unique<FolderExistsRule>(true));
|
||||||
engine_->addLocationRule("cgi_ext", std::make_unique<CgiExtValidationRule>(false));
|
engine_->addLocationRule("cgi_ext", std::make_unique<CgiExtValidationRule>(false));
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ CgiExtValidationRule::CgiExtValidationRule(bool requiresValue)
|
|||||||
|
|
||||||
bool isAllowedCGIExtension(const std::string &extension)
|
bool isAllowedCGIExtension(const std::string &extension)
|
||||||
{
|
{
|
||||||
static const std::vector<std::string> allowedExtensions = {".php", ".py"};
|
static const std::vector<std::string> allowedExtensions = {".php", ".py", ".bla"};
|
||||||
return std::ranges::any_of(allowedExtensions, [&extension](const auto &it) { return extension == it; });
|
return std::ranges::any_of(allowedExtensions, [&extension](const auto &it) { return extension == it; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user