aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSodface <sod@sodface.com>2022-11-02 17:39:27 -0400
committeralice <alice@ayaya.dev>2022-11-02 23:01:23 +0000
commit6d250183d8b0655325bcf34acbc1e61835159845 (patch)
tree13ffe0661eb1c148b9885d48d7023dca62a10341
parentcfc814207089bb94490a8c5d6edde1b3939f294d (diff)
community/althttpd: fix unnecessary redirects
-rw-r--r--community/althttpd/20-homepage-redirect-fix.patch14
1 files changed, 14 insertions, 0 deletions
diff --git a/community/althttpd/20-homepage-redirect-fix.patch b/community/althttpd/20-homepage-redirect-fix.patch
new file mode 100644
index 00000000000..fbd8a542d44
--- /dev/null
+++ b/community/althttpd/20-homepage-redirect-fix.patch
@@ -0,0 +1,14 @@
+This patch corrects an issue that causes althttpd to unnecessarily
+redirect all requests for the base domain, eg. http://example.com
+See-Also: https://sqlite.org/althttpd/forumpost/470f25d1b0
+--- ./althttpd.c.orig
++++ ./althttpd.c
+@@ -3055,7 +3055,7 @@
+ NotFound(400); /* LOG: URI is a directory w/o index.html */
+ }
+ zRealScript = StrDup(&zLine[j0]);
+- if( zScript[i]==0 ){
++ if( zScript[i]==0 && strcmp(zScript, "/")!=0 ){
+ /* If the requested URL does not end with "/" but we had to
+ ** append "index.html", then a redirect is necessary. Otherwise
+ ** none of the relative URLs in the delivered document will be