From ce42760b3e710223fa2fd3430e3325950ce6afa3 Mon Sep 17 00:00:00 2001 From: whaffman Date: Fri, 31 Oct 2025 10:05:32 +0100 Subject: [PATCH] fix: update trim function in removeEmptyLines to exclude semicolons --- webserv/utils/utils.cpp | 2 +- webserv/utils/utils.hpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/webserv/utils/utils.cpp b/webserv/utils/utils.cpp index 7e115e7..5189b47 100644 --- a/webserv/utils/utils.cpp +++ b/webserv/utils/utils.cpp @@ -89,7 +89,7 @@ void removeEmptyLines(std::string &str) { if (!utils::trim(line).empty()) { - result += utils::trim(line, " \t\n\r;") + '\n'; + result += utils::trim(line, " \t\n\r") + '\n'; } } str = result; diff --git a/webserv/utils/utils.hpp b/webserv/utils/utils.hpp index 992ccb1..62437e5 100644 --- a/webserv/utils/utils.hpp +++ b/webserv/utils/utils.hpp @@ -10,6 +10,8 @@ namespace utils { size_t stoul(const std::string &str, int base = 10); +std::string trimSemi(const std::string &str); + std::string trim(const std::string &str, const std::string &charset = " \t\n\r"); size_t findCorrespondingClosingBrace(const std::string &str, size_t openPos); void removeEmptyLines(std::string &str);