aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-09-16 00:09:08 +0000
committergoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-09-16 00:09:08 +0000
commitb2e36a5dddbc887f7eb786c4770834f224643d5f (patch)
treed6e1c6525ecb1c5135dba3c4ffa546b8e0a96e85
parenteaf2584a72a3128ed5df407cb8983e1e49fd1b04 (diff)
Check for a page with /index.html on the end as well.
Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@18 1faa4e14-9dd3-4be0-9f0e-ffe519881164
-rw-r--r--src/Server.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Server.c b/src/Server.c
index 416bdf6..b401ed3 100644
--- a/src/Server.c
+++ b/src/Server.c
@@ -284,16 +284,27 @@ static httpPage *FindPage(char *path, char **residual)
*residual = NULL;
free(temp);
}
+ else if((pagedata = Util_HashData(pages, strlen(path), path, 0)))
+ {
+ /* Or exact path */
+ *residual = NULL;
+ }
else
{
#ifdef HTTP_DEBUG
- printf("Looking for '%s'\n", path);
+ printf("Looking for '%s/index.html'\n", path);
#endif
- /* Or exact path */
- pagedata = Util_HashData(pages, strlen(path), path, 0);
+ temp = (char *)malloc(sizeof(path)+12);
+
+ sprintf(temp,"%s/index.html", path);
+
+ pagedata = Util_HashData(pages, strlen(temp), temp, 0);
+
*residual = NULL;
+ free(temp);
}
+
if(!pagedata)
{
/* Ok, now cycle through. Know it doesn't end with a slash */