Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/wn_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,24 @@ int webnet_module_handle_uri(struct webnet_session *session)
{
break;
}
#ifdef WEBNET_USING_GZIP
if (request->support_gzip)
{
int len = strlen(full_path);

if(len + sizeof(".gz") < WEBNET_PATH_MAX)
{
rt_memcpy(&full_path[len], ".gz", sizeof(".gz"));

if (stat(full_path, &file_stat) >= 0 && !S_ISDIR(file_stat.st_mode))
{
/* remove .gz */
full_path[len] = '\0';
break;
}
}
}
#endif /* WEBNET_USING_GZIP */
index ++;
}
_end_default_files:
Expand Down