Frank McCown wrote:
According to rfc1808 sec 5.2, the ".." should be left at the beginning of the URL path. But according to the new rfc3986 sec 5.4.2, the ".." should be removed from the beginning of the URL path.

With this new behavior implemented, wget would never make a URL request with ".." in it except in the query string. Therefore ".." would never need to be encoded since a query string with "blah/../blah" would always be encoded to "blah%2F..%2Fblah" and would not affect the file system path.

Frank


Here's the changes that I applied to fix the ".." problem:

In url.c:

- In function path_simplify: Commented-out the following lines:

/*  beg = t + 3;
    goto regular; */

- In function test_path_simplify: Changed the following tests to conform to rfc3986:

Replaced:

        { "..",                       "..",         0 },
        { "../",              "../",                0 },

with:

        { "..",                       "",           1 },
        { "../",              "",           1 },
        { "../foo",           "foo",                1 },

Replaced:

        { "foo/../..",                "..",         1 },
        { "foo/../../..",             "../..",      1 },
        { "foo/../../bar/../../baz", "../../baz",   1 },

with:

        { "foo/../..",                "",           1 },
        { "foo/../../..",             "",   1 },
        { "foo/../../bar/../../baz", "baz", 1 },


Frank

Reply via email to