]> git.kaiwu.me - nginx.git/commitdiff
Fixed request finalization in ngx_http_index_handler().
authorRuslan Ermilov <ru@nginx.com>
Mon, 16 Dec 2019 12:19:01 +0000 (15:19 +0300)
committerRuslan Ermilov <ru@nginx.com>
Mon, 16 Dec 2019 12:19:01 +0000 (15:19 +0300)
Returning 500 instead of NGX_ERROR is preferable here because
header has not yet been sent to the client.

src/http/modules/ngx_http_index_module.c

index c144b31c3a977955e99741f8cde5a0a1743332d4..2ee1dd5a449ae23d1697733ddd67281d23a44317 100644 (file)
@@ -163,7 +163,7 @@ ngx_http_index_handler(ngx_http_request_t *r)
 
             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;