From bf82cfdee89625f3077234080751ef814ceb8ac3 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Mon, 19 Aug 2013 23:04:06 +0200 Subject: [PATCH] Fixed favicon requests --- src/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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)) {