[nginx] Fixed request finalization in ngx_http_index_handler().

Ruslan Ermilov ru at nginx.com
Mon Dec 23 15:45:45 UTC 2019


details:   https://hg.nginx.org/nginx/rev/e55e28e6998f
branches:  
changeset: 7603:e55e28e6998f
user:      Ruslan Ermilov <ru at nginx.com>
date:      Mon Dec 16 15:19:01 2019 +0300
description:
Fixed request finalization in ngx_http_index_handler().

Returning 500 instead of NGX_ERROR is preferable here because
header has not yet been sent to the client.

diffstat:

 src/http/modules/ngx_http_index_module.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r b399246ea45d -r e55e28e6998f src/http/modules/ngx_http_index_module.c
--- a/src/http/modules/ngx_http_index_module.c	Mon Dec 16 15:19:01 2019 +0300
+++ b/src/http/modules/ngx_http_index_module.c	Mon Dec 16 15:19:01 2019 +0300
@@ -163,7 +163,7 @@
 
             name = ngx_http_map_uri_to_path(r, &path, &root, reserve);
             if (name == NULL) {
-                return NGX_ERROR;
+                return NGX_HTTP_INTERNAL_SERVER_ERROR;
             }
 
             allocated = path.data + path.len - name;


More information about the nginx-devel mailing list