Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libnginx-mod-http-fancyindex
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nginx
libnginx-mod-http-fancyindex
Commits
8749b23c
Verified
Commit
8749b23c
authored
2 years ago
by
Jan Mojžíš
Browse files
Options
Downloads
Patches
Plain Diff
d/p/0001-Fix-404-not-found-when-indexing-filesystem-root.patch add
parent
b5be52b8
No related branches found
No related tags found
No related merge requests found
Pipeline
#474085
passed
2 years ago
Stage: provisioning
Stage: build
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
debian/changelog
+1
-0
1 addition, 0 deletions
debian/changelog
debian/patches/0001-Fix-404-not-found-when-indexing-filesystem-root.patch
+50
-0
50 additions, 0 deletions
...001-Fix-404-not-found-when-indexing-filesystem-root.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
52 additions
and
0 deletions
debian/changelog
+
1
−
0
View file @
8749b23c
...
@@ -2,6 +2,7 @@ libnginx-mod-http-fancyindex (1:0.5.2-3) UNRELEASED; urgency=medium
...
@@ -2,6 +2,7 @@ libnginx-mod-http-fancyindex (1:0.5.2-3) UNRELEASED; urgency=medium
* d/t/generic rework. The test now checks module after
* d/t/generic rework. The test now checks module after
installation/reload/restart.
installation/reload/restart.
* d/p/0001-Fix-404-not-found-when-indexing-filesystem-root.patch added
-- Jan Mojžíš <jan.mojzis@gmail.com> Fri, 16 Dec 2022 04:39:55 +0100
-- Jan Mojžíš <jan.mojzis@gmail.com> Fri, 16 Dec 2022 04:39:55 +0100
...
...
This diff is collapsed.
Click to expand it.
debian/patches/0001-Fix-404-not-found-when-indexing-filesystem-root.patch
0 → 100644
+
50
−
0
View file @
8749b23c
From 83bef5c8a633ebbf96576eeb596a972a5816e057 Mon Sep 17 00:00:00 2001
From: Ryan Schmidt <git@ryandesign.com>
Date: Fri, 13 May 2022 00:16:09 -0500
Subject: [PATCH] Fix 404 not found when indexing filesystem root
Origin: https://github.com/aperezdc/ngx-fancyindex/commit/83bef5c8a633ebbf96576eeb596a972a5816e057
Forwarded: not-needed
Backport of https://github.com/nginx/nginx/commit/4c89c09ad8e574509446efab0347b124372bc53a
Fixes #107
---
ngx_http_fancyindex_module.c | 5 ++++-
t/bug107-filesystem-root-404.test | 9 +++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
create mode 100644 t/bug107-filesystem-root-404.test
diff --git a/ngx_http_fancyindex_module.c b/ngx_http_fancyindex_module.c
index e6928dd..dd721d0 100644
--- a/ngx_http_fancyindex_module.c
+++ b/ngx_http_fancyindex_module.c
@@ -684,7 +684,10 @@
make_content_buf(
return NGX_HTTP_INTERNAL_SERVER_ERROR;
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,
diff --git a/t/bug107-filesystem-root-404.test b/t/bug107-filesystem-root-404.test
new file mode 100644
index 0000000..2870910
--- /dev/null
+++ b/t/bug107-filesystem-root-404.test
@@ -0,0 +1,9 @@
+#! /bin/bash
+cat <<---
+Bug #107: 404 is returned when indexing filesystem root
+https://github.com/aperezdc/ngx-fancyindex/issues/107
+--
+nginx_start 'root /;'
+content=$(fetch)
+grep 'Index of /' <<< "${content}" # It is an index
+grep '<table\>' <<< "${content}" # It contains a table
--
2.30.2
This diff is collapsed.
Click to expand it.
debian/patches/series
0 → 100644
+
1
−
0
View file @
8749b23c
0001-Fix-404-not-found-when-indexing-filesystem-root.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment