Following cases regarding curly brackets should be handled (NINX accepts them)
1. Curly bracket on the next line
server
{
}
Here, the server is not recognized because a bracket is expected to come after the server directive. Therefore, it is not added. No error.
2. Whitespaces between server and bracket
server {
}
Here, the server is also not recognized because a space is expected to come after server, followed by the bracket. Therefore, it is not added. No error.
3. Directive on the same line as the bracket
server {
root /workspaces/webserv/; }
Here, an error occurs: "Semicolon missing". The function processRemainingLine(line); processes a line further if something is found after the semicolon. After only the bracket is filtered out and the loop continues, it checks again if there is a semicolon, which causes the error.
Following cases regarding curly brackets should be handled (NINX accepts them)
1. Curly bracket on the next line
Here, the server is not recognized because a bracket is expected to come after the server directive. Therefore, it is not added. No error.
2. Whitespaces between server and bracket
Here, the server is also not recognized because a space is expected to come after server, followed by the bracket. Therefore, it is not added. No error.
3. Directive on the same line as the bracket
Here, an error occurs: "Semicolon missing". The function
processRemainingLine(line);
processes a line further if something is found after the semicolon. After only the bracket is filtered out and the loop continues, it checks again if there is a semicolon, which causes the error.