From b2542f7778780de00d8573dd260c0358a1c25adf Mon Sep 17 00:00:00 2001 From: QXSoftware Date: Sat, 13 Oct 2018 17:09:06 +0800 Subject: eliminate double check for index.html if index.html exists --- src/supplemental/http/http_server.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c index 44c338f4..cdbfe3e6 100644 --- a/src/supplemental/http/http_server.c +++ b/src/supplemental/http/http_server.c @@ -1,6 +1,7 @@ // // Copyright 2018 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV +// Copyright 2018 QXSoftware // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -1460,9 +1461,9 @@ http_handle_dir(nni_aio *aio) sprintf(dst, "%s%s", NNG_PLATFORM_DIR_SEP, "index.html"); if (!nni_file_is_file(pn)) { pn[strlen(pn) - 1] = '\0'; // index.html -> index.htm - } - if (!nni_file_is_file(pn)) { - rv = NNG_ENOENT; + if (!nni_file_is_file(pn)) { + rv = NNG_ENOENT; + } } } -- cgit v1.2.3-70-g09d2