diff --git a/webserv/config/GlobalConfig.cpp b/webserv/config/GlobalConfig.cpp index acf34a3..05355f1 100644 --- a/webserv/config/GlobalConfig.cpp +++ b/webserv/config/GlobalConfig.cpp @@ -1,5 +1,4 @@ #include - #include // for Log #include // for findCorrespondingClosingBrace @@ -50,6 +49,11 @@ void GlobalConfig::parseBlock(const std::string &block) servers_.emplace_back(std::make_unique(serverBlock, this)); pos = closeBrace + 1; } + + if (block.find("location", 0) != std::string::npos) + { + throw std::runtime_error("Location blocks are not allowed in the global context."); + } parseDirectives(directives); }