mirror of
https://github.com/nginx/nginx.git
synced 2026-08-31 17:10:58 +00:00
fix autoindex for "alias /"
This commit is contained in:
parent
d47063bd90
commit
4c89c09ad8
2 changed files with 5 additions and 2 deletions
|
|
@ -181,7 +181,10 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
|
|||
}
|
||||
|
||||
allocated = path.len;
|
||||
path.len = last - path.data - 1;
|
||||
path.len = last - path.data;
|
||||
if (path.len > 1) {
|
||||
path.len--;
|
||||
}
|
||||
path.data[path.len] = '\0';
|
||||
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ ngx_http_index_test_dir(ngx_http_request_t *r, ngx_http_core_loc_conf_t *clcf,
|
|||
ngx_open_file_info_t of;
|
||||
|
||||
c = *last;
|
||||
if (c != '/') {
|
||||
if (c != '/' || path == last) {
|
||||
/* "alias" without trailing slash */
|
||||
c = *(++last);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue