i think the problem is in indexes.Here is my code:
char* indexes(const char* path)
{
char* path1 = malloc(sizeof(char) * (strlen(path) + 15));
strcat(strcpy(path1,path),"/index.html");
char* path2 = malloc(sizeof(char) * (strlen(path) + 15));
strcat(strcpy(path1,path),"/index.php");
if (access(path1,F_OK) != -1)
return path1;
else if (access(path2,F_OK) != -1)
{
free(path1);
return path2;
}
else
free(path2);
return NULL;
}
- :( Requesting cat.jpg returns 200, image/jpeg, and correct image :(
- Requesting cat.gif returns 200, image/gif, and correct file
- :( Requesting favicon.ico returns 200, image/x-icon, and correct file
- :( Requesting two files in a row (cat.html then cat.jpg) succeeds
printf("405 method not allowed");
in your parse function?