Skip to content
Browse files

Remove single . when normalizing path.

This is so that when two clients request the same location but
written in a different way, only 1 upstream request is made and
conflicts don't occur.
  • Loading branch information...
1 parent cc6f62e commit 1c3f979c9038542a69a2c3af61a2740419ffa9af @rosslagerwall committed Jun 25, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/pserv.c
View
4 src/pserv.c
@@ -69,7 +69,7 @@ pserv_free(struct ProxyServer *serv)
}
/* Adds the location to the base path and makes sure that the path is safe
- (i.e. doesn't contain any ..).
+ (i.e. doesn't contain any .. or .).
*/
static char *get_restricted_path(char *path)
{
@@ -87,7 +87,7 @@ static char *get_restricted_path(char *path)
/* Iterater through the path components, removing empty components or .. */
while (*cur) {
- if (strcmp(*cur, "..") && strcmp(*cur, "")) {
+ if (strcmp(*cur, "..") && strcmp(*cur, "") && strcmp(*cur, ".")) {
g_strlcat(result, "/", 1024);
g_strlcat(result, *cur, 1024);
}

0 comments on commit 1c3f979

Please sign in to comment.
Something went wrong with that request. Please try again.