diff --git a/src/main.c b/src/main.c index 124170c..01d67e2 100644 --- a/src/main.c +++ b/src/main.c @@ -428,6 +428,12 @@ static int connection_handler(void * cls, return MHD_NO; } + // serv the favicon, if requested + if(strcmp(url, "/favicon.png") == 0) { + LOG(LVL_INFO, "Serving FavIcon request."); + return MHD_queue_response(connection, MHD_HTTP_OK, faviconResponse); + } + // check if url contains a "/.." sequence. If so, block the request as it is // trying to access the parent directory (and may be an attempt to leave the // shared space. @@ -456,12 +462,6 @@ static int connection_handler(void * cls, return MHD_NO; // upload data in a GET!? } - // serv the favicon, if requested - if(strcmp(url, "/favicon.png") == 0) { - LOG(LVL_INFO, "Serving FavIcon request."); - return MHD_queue_response(connection, MHD_HTTP_OK, faviconResponse); - } - if(S_ISREG(connstate->targetStat.st_mode)) { return serv_regular_file(connection, connstate); } else if(S_ISDIR(connstate->targetStat.st_mode)) {