Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a48c681

Browse files
committed
Prevent server name validation from reading and evaluation simultaneously
1 parent 4324852 commit a48c681

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Response.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: lcouto <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2023/04/27 23:27:53 by lcouto #+# #+# */
9-
/* Updated: 2023/05/26 02:36:29 by lcouto ### ########.fr */
9+
/* Updated: 2023/05/26 03:06:48 by lcouto ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -55,7 +55,8 @@ void Response::setRequest(Request request) { this->_request = request; }
5555

5656
void Response::assembleResponseString(void)
5757
{
58-
if (!this->_serverData->getValue("server_name").empty())
58+
std::vector<std::string> serverNames = this->_serverData->getValue("server_name");
59+
if (!serverNames.empty())
5960
validateServerName();
6061

6162
std::string responseString, headersString;

0 commit comments

Comments
 (0)