Uri problem/bug

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sunny

    #1

    Uri problem/bug

    Hi all,
    I have found a possible bug in the Uri class constructor.
    When I make something like this:
    test = new Uri(@"http://www.test.com/dir1/page1.html");

    test2 = new Uri(test, @"../../page2.html");

    in test2.Absolutet Path I receive http://www.test.com/../page2.html.

    I know that you can not go before the /test/ dir, and that why there is
    strange result. And if you try to use test2 ageist a website, it crashes,
    while if you open such a page (page1.htm) in a browser (IE) and click on
    such a link, it navigates to http://test.com/page2.html. So I'm wondering
    ....

    And yes, there is such a page (not mine) which I have to parse.

    I am checking for such a links and replace "../" with "", but maybe this
    have to be reposted somewhere as a possible bug.



    Sunny

  • Greg Ewing [MVP]

    #2
    Re: Uri problem/bug

    Sunny, when you create test2 you are creating it with the following URL:

    http://www.test.com/dir1/../../page2.html

    which is really

    http://www.test.com/../page2.html (the first .. goes down 1 dir, eliminating
    the dir1 ref)

    So, the URI class is returning the correct AbsolutePath. Does that make
    sense? If you can give some more details about what you are trying to do
    I'm sure we could help you here.

    --
    Greg Ewing [MVP]
    IT support built exclusively for nonprofits. 25 years of managed IT, help desk, and cybersecurity - so your team can focus on your mission.



    "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
    news:#TxvOuYdDH A.1752@TK2MSFTN GP11.phx.gbl...[color=blue]
    > Hi all,
    > I have found a possible bug in the Uri class constructor.
    > When I make something like this:
    > test = new Uri(@"http://www.test.com/dir1/page1.html");
    >
    > test2 = new Uri(test, @"../../page2.html");
    >
    > in test2.Absolutet Path I receive http://www.test.com/../page2.html.
    >
    > I know that you can not go before the /test/ dir, and that why there is
    > strange result. And if you try to use test2 ageist a website, it crashes,
    > while if you open such a page (page1.htm) in a browser (IE) and click on
    > such a link, it navigates to http://test.com/page2.html. So I'm wondering
    > ...
    >
    > And yes, there is such a page (not mine) which I have to parse.
    >
    > I am checking for such a links and replace "../" with "", but maybe this
    > have to be reposted somewhere as a possible bug.
    >
    >
    >
    > Sunny
    >[/color]


    Comment

    • Sunny

      #3
      Re: Uri problem/bug

      I know that this is not a valid construct ( as far as ".." is a pointer to
      the upper dir in most OSes, and for sure for all web servers).

      I have to parse an html page (lets say page1.html from the example), in
      which, because of bad (?) design maybe, there is "<img
      src="../../image.gif". Even then, in IE and Netscape, the image is
      displayed, but if I use Uris' to prepare the whole URL from the base page, I
      receive the result I post. And then I can not use directly
      imgUri.Absolute Path to download the image.
      As far as I'm concerned of that problem, I just check the result URL and
      correct it by removing "../", but I just wanted to know where is the problem
      for this different behavior in Uri class and browser.
      I have posted this just to start a discussion in that direction. I can
      assume that there are not so many so bad coded web pages, but ...

      Thanks for reading all this
      Sunny

      P.S. I try to download the image (if it does matter) with:
      System.Net.WebC lient source = new System.Net.WebC lient();

      Stream myData = null;

      myData = source.OpenRead (sUrl);

      byte[] buffer = new byte[4096];

      int br = buffer.Length;

      while (br == buffer.Length)

      br = myData.Read(buf fer, 0, buffer.Length);



      Actually my code breaks in OpenRead method.

      Sunny


      "Greg Ewing [MVP]" <gewing@_NO_SPA M_gewing.com> wrote in message
      news:uzz3x5YdDH A.1752@TK2MSFTN GP11.phx.gbl...[color=blue]
      > Sunny, when you create test2 you are creating it with the following URL:
      >
      > http://www.test.com/dir1/../../page2.html
      >
      > which is really
      >
      > http://www.test.com/../page2.html (the first .. goes down 1 dir,[/color]
      eliminating[color=blue]
      > the dir1 ref)
      >
      > So, the URI class is returning the correct AbsolutePath. Does that make
      > sense? If you can give some more details about what you are trying to do
      > I'm sure we could help you here.
      >
      > --
      > Greg Ewing [MVP]
      > http://www.citidc.com
      >
      >
      > "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
      > news:#TxvOuYdDH A.1752@TK2MSFTN GP11.phx.gbl...[color=green]
      > > Hi all,
      > > I have found a possible bug in the Uri class constructor.
      > > When I make something like this:
      > > test = new Uri(@"http://www.test.com/dir1/page1.html");
      > >
      > > test2 = new Uri(test, @"../../page2.html");
      > >
      > > in test2.Absolutet Path I receive http://www.test.com/../page2.html.
      > >
      > > I know that you can not go before the /test/ dir, and that why there is
      > > strange result. And if you try to use test2 ageist a website, it[/color][/color]
      crashes,[color=blue][color=green]
      > > while if you open such a page (page1.htm) in a browser (IE) and click on
      > > such a link, it navigates to http://test.com/page2.html. So I'm[/color][/color]
      wondering[color=blue][color=green]
      > > ...
      > >
      > > And yes, there is such a page (not mine) which I have to parse.
      > >
      > > I am checking for such a links and replace "../" with "", but maybe this
      > > have to be reposted somewhere as a possible bug.
      > >
      > >
      > >
      > > Sunny
      > >[/color]
      >
      >[/color]

      Comment

      • Peter Huang [MSFT]

        #4
        Re: Uri problem/bug

        Hi Sunny,

        I have made a test on my machine and found that
        <img src="../../image.gif"
        if current path is in the root of the website,(usuall y the root is the
        wwwroot directory), then the ../../image.gif will be parsed to image.gif.
        that is to say, in the <img src="../../image.gif"> when the current path
        is at the root of the website, then the ../ which used to get the upper
        directory will be skipped.
        So when the current directory is root of the website, e.g.

        then the <img src="../../image.gif"> section in the test.htm will equal
        to <img src="../image.gif"> as well as <img src="image.gif" >.
        I suggest when you parse the htm file, you need to get he current path to
        see if it is the root of the website, in such case , you may need to
        neglect the ../ as I discussed above.

        Did I misunderstand your meaing?
        I look forward to hearing from you.


        Regards,
        Peter Huang
        Microsoft Online Partner Support
        Get Secure! www.microsoft.com/security
        This posting is provided "as is" with no warranties and confers no rights.
        --------------------[color=blue]
        >From: "Sunny" <sunnyask@icebe rgwireless.com>
        >References: <#TxvOuYdDHA.17 52@TK2MSFTNGP11 .phx.gbl>[/color]
        <uzz3x5YdDHA.17 52@TK2MSFTNGP11 .phx.gbl>[color=blue]
        >Subject: Re: Uri problem/bug
        >Date: Sun, 7 Sep 2003 22:59:41 -0500
        >Lines: 92
        >MIME-Version: 1.0
        >Content-Type: text/plain;
        > charset="koi8-r"
        >Content-Transfer-Encoding: 7bit
        >X-Priority: 3
        >X-MSMail-Priority: Normal
        >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
        >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
        >Message-ID: <eH$bj2bdDHA.24 36@TK2MSFTNGP09 .phx.gbl>
        >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
        >NNTP-Posting-Host: c-66-41-159-114.mn.client2. attbi.com 66.41.159.114
        >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
        >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1830 78
        >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
        >
        >I know that this is not a valid construct ( as far as ".." is a pointer to
        >the upper dir in most OSes, and for sure for all web servers).
        >
        >I have to parse an html page (lets say page1.html from the example), in
        >which, because of bad (?) design maybe, there is "<img
        >src="../../image.gif". Even then, in IE and Netscape, the image is
        >displayed, but if I use Uris' to prepare the whole URL from the base page,[/color]
        I[color=blue]
        >receive the result I post. And then I can not use directly
        >imgUri.Absolut ePath to download the image.
        >As far as I'm concerned of that problem, I just check the result URL and
        >correct it by removing "../", but I just wanted to know where is the[/color]
        problem[color=blue]
        >for this different behavior in Uri class and browser.
        >I have posted this just to start a discussion in that direction. I can
        >assume that there are not so many so bad coded web pages, but ...
        >
        >Thanks for reading all this
        >Sunny
        >
        >P.S. I try to download the image (if it does matter) with:
        >System.Net.Web Client source = new System.Net.WebC lient();
        >
        >Stream myData = null;
        >
        >myData = source.OpenRead (sUrl);
        >
        >byte[] buffer = new byte[4096];
        >
        >int br = buffer.Length;
        >
        >while (br == buffer.Length)
        >
        > br = myData.Read(buf fer, 0, buffer.Length);
        >
        >
        >
        >Actually my code breaks in OpenRead method.
        >
        >Sunny
        >
        >
        >"Greg Ewing [MVP]" <gewing@_NO_SPA M_gewing.com> wrote in message
        >news:uzz3x5YdD HA.1752@TK2MSFT NGP11.phx.gbl.. .[color=green]
        >> Sunny, when you create test2 you are creating it with the following URL:
        >>
        >> http://www.test.com/dir1/../../page2.html
        >>
        >> which is really
        >>
        >> http://www.test.com/../page2.html (the first .. goes down 1 dir,[/color]
        >eliminating[color=green]
        >> the dir1 ref)
        >>
        >> So, the URI class is returning the correct AbsolutePath. Does that make
        >> sense? If you can give some more details about what you are trying to do
        >> I'm sure we could help you here.
        >>
        >> --
        >> Greg Ewing [MVP]
        >> http://www.citidc.com
        >>
        >>
        >> "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
        >> news:#TxvOuYdDH A.1752@TK2MSFTN GP11.phx.gbl...[color=darkred]
        >> > Hi all,
        >> > I have found a possible bug in the Uri class constructor.
        >> > When I make something like this:
        >> > test = new Uri(@"http://www.test.com/dir1/page1.html");
        >> >
        >> > test2 = new Uri(test, @"../../page2.html");
        >> >
        >> > in test2.Absolutet Path I receive http://www.test.com/../page2.html.
        >> >
        >> > I know that you can not go before the /test/ dir, and that why there is
        >> > strange result. And if you try to use test2 ageist a website, it[/color][/color]
        >crashes,[color=green][color=darkred]
        >> > while if you open such a page (page1.htm) in a browser (IE) and click[/color][/color][/color]
        on[color=blue][color=green][color=darkred]
        >> > such a link, it navigates to http://test.com/page2.html. So I'm[/color][/color]
        >wondering[color=green][color=darkred]
        >> > ...
        >> >
        >> > And yes, there is such a page (not mine) which I have to parse.
        >> >
        >> > I am checking for such a links and replace "../" with "", but maybe[/color][/color][/color]
        this[color=blue][color=green][color=darkred]
        >> > have to be reposted somewhere as a possible bug.
        >> >
        >> >
        >> >
        >> > Sunny
        >> >[/color]
        >>
        >>[/color]
        >
        >[/color]

        Comment

        • Sunny

          #5
          Re: Uri problem/bug

          In article <uAV9FKgdDHA.46 0@cpmsftngxa06. phx.gbl>, v-
          phuang@online.m icrosoft.com says...[color=blue]
          > Hi Sunny,
          >
          > I have made a test on my machine and found that
          > <img src="../../image.gif"
          > if current path is in the root of the website,(usuall y the root is the
          > wwwroot directory), then the ../../image.gif will be parsed to image.gif.
          > that is to say, in the <img src="../../image.gif"> when the current path
          > is at the root of the website, then the ../ which used to get the upper
          > directory will be skipped.
          > So when the current directory is root of the website, e.g.
          > http://localhost/test.htm
          > then the <img src="../../image.gif"> section in the test.htm will equal
          > to <img src="../image.gif"> as well as <img src="image.gif" >.
          > I suggest when you parse the htm file, you need to get he current path to
          > see if it is the root of the website, in such case , you may need to
          > neglect the ../ as I discussed above.
          >
          > Did I misunderstand your meaing?
          > I look forward to hearing from you.
          >
          >
          > Regards,
          > Peter Huang
          > Microsoft Online Partner Support
          > Get Secure! www.microsoft.com/security
          > This posting is provided "as is" with no warranties and confers no rights.
          > --------------------[/color]


          Hi Peter,
          Yes, you have understood me correctly. There is no problem at all, as I
          check for that (../../).
          The main point of my original post was that the way web browsers and Uri
          constructor deals with that issue are different (and the way browsers do
          it, is the right one). I thing that this is a possible bug in the Uri
          class, as far as most of OSystems use ".." to point to the upper dir.
          So I can no accept that new Uri(baseuri, sPath) can return an uri which
          likes "http://test.com/../image.gif" and you have by yourself to check
          for this.
          I have started this thread only as a warning to other developers, and to
          MS team, if they read this group.

          And if someone thinks that Uri SHOULD act like this, because of any
          reason, I'd like to hear it.

          Thanks
          Sunny

          Comment

          • Peter Huang [MSFT]

            #6
            Re: Uri problem/bug

            Hi Sunny,


            the uri you posted will not work in an IE browser either, it seems that the
            uri is parsed from the html file, isn't it?
            I think the IE browser is for compatibility concern. Since there are many
            links on the web that will not work, that was why browser must be strong
            compatibility.
            Since the http://test.com/../image.gif doesn't not work in the ie, but the
            <img src="../image.gif> works, it is all because of the compatibility.
            But to uri class, it can not guarantee that the http://test.com/image.gif
            will work, then it didn't not check if it is necessary to skip "../" when
            encounter the root.


            Regards,
            Peter Huang
            Microsoft Online Partner Support
            Get Secure! www.microsoft.com/security
            This posting is provided "as is" with no warranties and confers no rights.
            --------------------[color=blue]
            >From: Sunny <sunnyask@icebe rgwireless.com>
            >Subject: Re: Uri problem/bug
            >Date: Mon, 8 Sep 2003 10:28:59 -0500
            >Message-ID: <MPG.19c65bf318 6a4549989683@ms news.microsoft. com>
            >References: <#TxvOuYdDHA.17 52@TK2MSFTNGP11 .phx.gbl>[/color]
            <uzz3x5YdDHA.17 52@TK2MSFTNGP11 .phx.gbl>
            <eH$bj2bdDHA.24 36@TK2MSFTNGP09 .phx.gbl>
            <uAV9FKgdDHA.46 0@cpmsftngxa06. phx.gbl>[color=blue]
            >Organization : Iceberg Wireless LLC
            >MIME-Version: 1.0
            >Content-Type: text/plain; charset="iso-8859-15"
            >Content-Transfer-Encoding: 7bit
            >X-Newsreader: MicroPlanet Gravity v2.60
            >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
            >NNTP-Posting-Host: 216.17.90.91
            >Lines: 1
            >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
            >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1832 15
            >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
            >
            >In article <uAV9FKgdDHA.46 0@cpmsftngxa06. phx.gbl>, v-
            >phuang@online. microsoft.com says...[color=green]
            >> Hi Sunny,
            >>
            >> I have made a test on my machine and found that
            >> <img src="../../image.gif"
            >> if current path is in the root of the website,(usuall y the root is the
            >> wwwroot directory), then the ../../image.gif will be parsed to image.gif.
            >> that is to say, in the <img src="../../image.gif"> when the current[/color][/color]
            path[color=blue][color=green]
            >> is at the root of the website, then the ../ which used to get the upper
            >> directory will be skipped.
            >> So when the current directory is root of the website, e.g.
            >> http://localhost/test.htm
            >> then the <img src="../../image.gif"> section in the test.htm will[/color][/color]
            equal[color=blue][color=green]
            >> to <img src="../image.gif"> as well as <img src="image.gif" >.
            >> I suggest when you parse the htm file, you need to get he current path[/color][/color]
            to[color=blue][color=green]
            >> see if it is the root of the website, in such case , you may need to
            >> neglect the ../ as I discussed above.
            >>
            >> Did I misunderstand your meaing?
            >> I look forward to hearing from you.
            >>
            >>
            >> Regards,
            >> Peter Huang
            >> Microsoft Online Partner Support
            >> Get Secure! www.microsoft.com/security
            >> This posting is provided "as is" with no warranties and confers no[/color][/color]
            rights.[color=blue][color=green]
            >> --------------------[/color]
            >
            >
            >Hi Peter,
            >Yes, you have understood me correctly. There is no problem at all, as I
            >check for that (../../).
            >The main point of my original post was that the way web browsers and Uri
            >constructor deals with that issue are different (and the way browsers do
            >it, is the right one). I thing that this is a possible bug in the Uri
            >class, as far as most of OSystems use ".." to point to the upper dir.
            >So I can no accept that new Uri(baseuri, sPath) can return an uri which
            >likes "http://test.com/../image.gif" and you have by yourself to check
            >for this.
            >I have started this thread only as a warning to other developers, and to
            >MS team, if they read this group.
            >
            >And if someone thinks that Uri SHOULD act like this, because of any
            >reason, I'd like to hear it.
            >
            >Thanks
            >Sunny
            >[/color]

            Comment

            • Sunny

              #7
              Re: Uri problem/bug

              Hi Peter,
              yes, that was my mistake, actually if you are looking a page
              http://test.com/dir1/page1.html, and in there is a image with
              src="../../image.gif", the browser will find it.
              But do you think that browser first tries to get from
              test.com/../image.gif, and if no success (for sure :) ), it'll try the
              correct one, or it just inspects that link like /../image.gif is not
              valid and directly tries the other?
              So, I agree that Uri is strict, and it can not "suppose" to remove ../,
              but at least it has to note that this is not a valid construct, and to
              note somehow the user code (throw exception?).

              Cheers
              Sunny

              In article <U6kk9isdDHA.25 36@cpmsftngxa06 .phx.gbl>, v-
              phuang@online.m icrosoft.com says...[color=blue]
              > Hi Sunny,
              >
              > http://test.com/../image.gif
              > the uri you posted will not work in an IE browser either, it seems that the
              > uri is parsed from the html file, isn't it?
              > I think the IE browser is for compatibility concern. Since there are many
              > links on the web that will not work, that was why browser must be strong
              > compatibility.
              > Since the http://test.com/../image.gif doesn't not work in the ie, but the
              > <img src="../image.gif> works, it is all because of the compatibility.
              > But to uri class, it can not guarantee that the http://test.com/image.gif
              > will work, then it didn't not check if it is necessary to skip "../" when
              > encounter the root.
              >
              >
              > Regards,
              > Peter Huang
              > Microsoft Online Partner Support
              > Get Secure! www.microsoft.com/security
              > This posting is provided "as is" with no warranties and confers no rights.
              > --------------------[color=green]
              > >From: Sunny <sunnyask@icebe rgwireless.com>
              > >Subject: Re: Uri problem/bug
              > >Date: Mon, 8 Sep 2003 10:28:59 -0500
              > >Message-ID: <MPG.19c65bf318 6a4549989683@ms news.microsoft. com>
              > >References: <#TxvOuYdDHA.17 52@TK2MSFTNGP11 .phx.gbl>[/color]
              > <uzz3x5YdDHA.17 52@TK2MSFTNGP11 .phx.gbl>
              > <eH$bj2bdDHA.24 36@TK2MSFTNGP09 .phx.gbl>
              > <uAV9FKgdDHA.46 0@cpmsftngxa06. phx.gbl>[color=green]
              > >Organization : Iceberg Wireless LLC
              > >MIME-Version: 1.0
              > >Content-Type: text/plain; charset="iso-8859-15"
              > >Content-Transfer-Encoding: 7bit
              > >X-Newsreader: MicroPlanet Gravity v2.60
              > >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
              > >NNTP-Posting-Host: 216.17.90.91
              > >Lines: 1
              > >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
              > >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1832 15
              > >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
              > >
              > >In article <uAV9FKgdDHA.46 0@cpmsftngxa06. phx.gbl>, v-
              > >phuang@online. microsoft.com says...[color=darkred]
              > >> Hi Sunny,
              > >>
              > >> I have made a test on my machine and found that
              > >> <img src="../../image.gif"
              > >> if current path is in the root of the website,(usuall y the root is the
              > >> wwwroot directory), then the ../../image.gif will be parsed to image.gif.
              > >> that is to say, in the <img src="../../image.gif"> when the current[/color][/color][/color]

              Comment

              • Peter Huang [MSFT]

                #8
                Re: Uri problem/bug

                Hi Sunny,

                I think the behavior is by design.
                In the RFC specification, it said.
                e) All occurrences of "<segment>/../", where <segment> is a
                complete path segment not equal to "..", are removed from the
                buffer string. Removal of these path segments is performed
                iteratively, removing the leftmost matching pattern on each
                iteration, until no matching pattern remains.

                f) If the buffer string ends with "<segment>/..", where <segment>
                is a complete path segment not equal to "..", that
                "<segment>/.." is removed.

                For more information, please refer to the link below


                Regards,
                Peter Huang
                Microsoft Online Partner Support
                Get Secure! www.microsoft.com/security
                This posting is provided "as is" with no warranties and confers no rights.

                --------------------[color=blue]
                >From: Sunny <sunnyask@icebe rgwireless.com>
                >Subject: Re: Uri problem/bug
                >Date: Tue, 9 Sep 2003 09:44:16 -0500
                >Message-ID: <MPG.19c7a33c6e def321989689@ms news.microsoft. com>
                >References: <#TxvOuYdDHA.17 52@TK2MSFTNGP11 .phx.gbl>[/color]
                <uzz3x5YdDHA.17 52@TK2MSFTNGP11 .phx.gbl>
                <eH$bj2bdDHA.24 36@TK2MSFTNGP09 .phx.gbl>
                <uAV9FKgdDHA.46 0@cpmsftngxa06. phx.gbl>
                <MPG.19c65bf318 6a4549989683@ms news.microsoft. com>
                <U6kk9isdDHA.25 36@cpmsftngxa06 .phx.gbl>[color=blue]
                >Organization : Iceberg Wireless LLC
                >MIME-Version: 1.0
                >Content-Type: text/plain; charset="iso-8859-15"
                >Content-Transfer-Encoding: 7bit
                >X-Newsreader: MicroPlanet Gravity v2.60
                >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                >NNTP-Posting-Host: 216.17.90.91
                >Lines: 1
                >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
                >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1834 87
                >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                >
                >Hi Peter,
                >yes, that was my mistake, actually if you are looking a page
                >http://test.com/dir1/page1.html, and in there is a image with
                >src="../../image.gif", the browser will find it.
                >But do you think that browser first tries to get from
                >test.com/../image.gif, and if no success (for sure :) ), it'll try the
                >correct one, or it just inspects that link like /../image.gif is not
                >valid and directly tries the other?
                >So, I agree that Uri is strict, and it can not "suppose" to remove ../,
                >but at least it has to note that this is not a valid construct, and to
                >note somehow the user code (throw exception?).
                >
                >Cheers
                >Sunny
                >
                >In article <U6kk9isdDHA.25 36@cpmsftngxa06 .phx.gbl>, v-
                >phuang@online. microsoft.com says...[color=green]
                >> Hi Sunny,
                >>
                >> http://test.com/../image.gif
                >> the uri you posted will not work in an IE browser either, it seems that[/color][/color]
                the[color=blue][color=green]
                >> uri is parsed from the html file, isn't it?
                >> I think the IE browser is for compatibility concern. Since there are[/color][/color]
                many[color=blue][color=green]
                >> links on the web that will not work, that was why browser must be strong
                >> compatibility.
                >> Since the http://test.com/../image.gif doesn't not work in the ie, but[/color][/color]
                the[color=blue][color=green]
                >> <img src="../image.gif> works, it is all because of the compatibility.
                >> But to uri class, it can not guarantee that the[/color][/color]
                http://test.com/image.gif[color=blue][color=green]
                >> will work, then it didn't not check if it is necessary to skip "../"[/color][/color]
                when[color=blue][color=green]
                >> encounter the root.
                >>
                >>
                >> Regards,
                >> Peter Huang
                >> Microsoft Online Partner Support
                >> Get Secure! www.microsoft.com/security
                >> This posting is provided "as is" with no warranties and confers no[/color][/color]
                rights.[color=blue][color=green]
                >> --------------------[color=darkred]
                >> >From: Sunny <sunnyask@icebe rgwireless.com>
                >> >Subject: Re: Uri problem/bug
                >> >Date: Mon, 8 Sep 2003 10:28:59 -0500
                >> >Message-ID: <MPG.19c65bf318 6a4549989683@ms news.microsoft. com>
                >> >References: <#TxvOuYdDHA.17 52@TK2MSFTNGP11 .phx.gbl>[/color]
                >> <uzz3x5YdDHA.17 52@TK2MSFTNGP11 .phx.gbl>
                >> <eH$bj2bdDHA.24 36@TK2MSFTNGP09 .phx.gbl>
                >> <uAV9FKgdDHA.46 0@cpmsftngxa06. phx.gbl>[color=darkred]
                >> >Organization : Iceberg Wireless LLC
                >> >MIME-Version: 1.0
                >> >Content-Type: text/plain; charset="iso-8859-15"
                >> >Content-Transfer-Encoding: 7bit
                >> >X-Newsreader: MicroPlanet Gravity v2.60
                >> >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                >> >NNTP-Posting-Host: 216.17.90.91
                >> >Lines: 1
                >> >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
                >> >Xref: cpmsftngxa06.ph x.gbl[/color][/color][/color]
                microsoft.publi c.dotnet.langua ges.csharp:1832 15[color=blue][color=green][color=darkred]
                >> >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                >> >
                >> >In article <uAV9FKgdDHA.46 0@cpmsftngxa06. phx.gbl>, v-
                >> >phuang@online. microsoft.com says...
                >> >> Hi Sunny,
                >> >>
                >> >> I have made a test on my machine and found that
                >> >> <img src="../../image.gif"
                >> >> if current path is in the root of the website,(usuall y the root is[/color][/color][/color]
                the[color=blue][color=green][color=darkred]
                >> >> wwwroot directory), then the ../../image.gif will be parsed to[/color][/color][/color]
                image.gif.[color=blue][color=green][color=darkred]
                >> >> that is to say, in the <img src="../../image.gif"> when the current[/color][/color]
                >[/color]

                Comment

                Working...