@@ -36,14 +36,14 @@ void Http::OnRequestRecv(std::string msg) {
3636 parseRet |= _request.getUri ().decode ();
3737 accessLog_g.write (" Decoded URI: " + _request.getUri ().generate (), DEBUG);
3838
39- bool validPath = ! _request.getUri ().resolveDots ();
39+ bool validPath = ( _request.getUri ().resolveDots () == false );
4040 accessLog_g.write (" Resolved URI: " + _request.getUri ().generate (), DEBUG);
4141
4242 const Uri &uriRef = _request.getUri ();
4343 validPath &= startsWith (uriRef.getPath (), " /" ) ||
4444 (_request.isMethod (" OPTIONS" ) && uriRef.getPath () == " *" );
4545
46- if (parseRet || ! validPath)
46+ if (parseRet || validPath == false )
4747 processError (" 400" , " Bad Request" , true );
4848 else if (isHttpVersionValid (_request.getVersion ()) == false ) {
4949 processError (" 505" , " HTTP Version Not Supported" , true );
@@ -116,7 +116,8 @@ void Http::OnTrailerRecv(std::string msg) {
116116
117117void Http::OnBodyRecv (std::string msg) {
118118 if (_request.hasHeaderFieldValue (" Transfer-Encoding" , " chunked" )) {
119- if (!endsWith (msg, " \r\n " )) return processError (" 400" , " Bad Request" , true );
119+ if (endsWith (msg, " \r\n " ) == false )
120+ return processError (" 400" , " Bad Request" , true );
120121 msg.erase (msg.size () - 2 , 2 );
121122 }
122123 accessLog_g.write (" HTTP body: '" + msg + " '" , VERBOSE);
@@ -245,13 +246,13 @@ void Http::processFile(std::string uri) {
245246
246247 // Set mime type
247248 std::string mimeType = VirtualHost::getMimeType (file.getExtension ());
248- if (! mimeType.empty ()) _response.setHeader (" Content-Type" , mimeType);
249+ if (mimeType.empty () == false ) _response.setHeader (" Content-Type" , mimeType);
249250 _response.setReady ();
250251}
251252
252253void Http::processCgi (std::string contentLength) {
253254 std::string pathname (cgiFilePathname);
254- if (! startsWith (pathname, " /" )) pathname.insert (0 , cwd_g);
255+ if (startsWith (pathname, " /" ) == false ) pathname.insert (0 , cwd_g);
255256
256257 std::vector<std::string> env;
257258 // const values:
@@ -328,7 +329,7 @@ void Http::processBodyRequest() {
328329 return processFile (_uri);
329330 else if (_request.isMethod (" PUT" )) {
330331 std::string path = _context->getDirective (" root" , true )[0 ][0 ] + _uri;
331- _newFile = ! File (path).exists ();
332+ _newFile = ( File (path).exists () == false );
332333
333334 if (!File (File (path).getDir ()).exists ())
334335 return processError (" 404" , " Not found" );
@@ -504,14 +505,15 @@ void Http::addIndexToPath(File &file, std::string &uri) {
504505}
505506
506507void Http::checkResourceValidity (const File &file, const std::string &uri) {
507- if (! file.exists ()) return processError (" 404" , " Not Found" );
508+ if (file.exists () == false ) return processError (" 404" , " Not Found" );
508509 if (file.dir ()) {
509- if (!endsWith (file.getPath (), " /" )) return processRedirect (uri + " /" );
510+ if (endsWith (file.getPath (), " /" ) == false )
511+ return processRedirect (uri + " /" );
510512 if (_context->exists (" autoindex" , true ) &&
511513 _context->getDirective (" autoindex" , true )[0 ][0 ] == " on" )
512514 return processAutoindex (uri);
513515 return processError (" 403" , " Forbidden" );
514- } else if (! file.readable ())
516+ } else if (file.readable () == false )
515517 return processError (" 403" , " Forbidden" );
516518}
517519
@@ -622,7 +624,7 @@ bool Http::isBodySizeValid(size_t size) const {
622624}
623625
624626std::string Http::getCgiPath (std::string extension) const {
625- if (! _context->exists (" cgi" , true )) return " " ;
627+ if (_context->exists (" cgi" , true ) == false ) return " " ;
626628 std::vector<std::vector<std::string> > &cgis =
627629 _context->getDirective (" cgi" , true );
628630 for (size_t i = 0 ; i < cgis.size (); i++)
0 commit comments