diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index 096ecb8..395af3f 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -305,8 +305,8 @@ static int accessHandlerCallback(void *cls, if (patternCorrespondingUrl.empty() && searcher != NULL) { const char* start = MHD_lookup_connection_value(connection, MHD_GET_ARGUMENT_KIND, "start"); const char* end = MHD_lookup_connection_value(connection, MHD_GET_ARGUMENT_KIND, "end"); - unsigned int startNumber = (start != NULL ? atoi(start) : 0); - unsigned int endNumber = (end != NULL ? atoi(end) : 25); + unsigned int startNumber = start != NULL ? atoi(start) : 0; + unsigned int endNumber = end != NULL ? atoi(end) : 25; /* Get the results */ pthread_mutex_lock(&searcherLock); @@ -317,13 +317,12 @@ static int accessHandlerCallback(void *cls, std::cerr << e.what() << std::endl; } pthread_mutex_unlock(&searcherLock); - - mimeType = "text/html; charset=utf-8"; } else { content = "\n
There is no article with the title \"" + patternString + "\" and the fulltext search engine is not available for this content.
"; - mimeType = "text/html"; httpResponseCode = MHD_HTTP_NOT_FOUND; } + + mimeType = "text/html; charset=utf-8"; } /* Display a random article */