Jetty
  1. Jetty
  2. JETTY-123

Unable to access warfile by UNC-Path

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0
    • Fix Version/s: 6.1.0rc0
    • Component/s: None
    • Labels:
      None
    • Environment:
      windows xp
    • Number of attachments :
      1

      Description

      Jetty embedded in my java application is unable to access \\host\path\to\foo.war

      Converting a file located on a unc path between File, URI and URL formats usually results in broken urls.

      The attached patch fixes this problem.

        Activity

        Hide
        Greg Wilkins added a comment -

        I have checked in a variation of your patch into trunk.
        I am always cautious about this kind of stuff, as I do not want to introduce the ability
        of aliasing. Users can pass in all sorts of strange stuff that will end up in this code.

        So currently a fix for this in intended only for 6.1, so we can have some time to test etc.

        Could I get you to check the svn trunk to make sure that my variation has not broken
        anything.

        Show
        Greg Wilkins added a comment - I have checked in a variation of your patch into trunk. I am always cautious about this kind of stuff, as I do not want to introduce the ability of aliasing. Users can pass in all sorts of strange stuff that will end up in this code. So currently a fix for this in intended only for 6.1, so we can have some time to test etc. Could I get you to check the svn trunk to make sure that my variation has not broken anything.
        Hide
        Yug added a comment -

        Sorry for the long delay, I was quite busy. Unfortunately, your variation does not work for non-ascii characters in unc paths.
        Example path: \\crushinator\ \admin.war

        URIUtil.decodePath(url.getFile())
        will replace and by \ufffd which breaks the path

        replaceAll("%20", " ")
        works well for me

        Show
        Yug added a comment - Sorry for the long delay, I was quite busy. Unfortunately, your variation does not work for non-ascii characters in unc paths. Example path: \\crushinator\ \admin.war URIUtil.decodePath(url.getFile()) will replace and by \ufffd which breaks the path replaceAll("%20", " ") works well for me
        Hide
        Yug added a comment -

        I would like to reopen the issue, but either I have no permission to do so or I am too stupid to find the link or button.

        Show
        Yug added a comment - I would like to reopen the issue, but either I have no permission to do so or I am too stupid to find the link or button.
        Hide
        Greg Wilkins added a comment -

        I have added a new decodePath that does not treat characters as bytes. Only % encoded bits are treated as bytes.

        checked in now... please try

        Show
        Greg Wilkins added a comment - I have added a new decodePath that does not treat characters as bytes. Only % encoded bits are treated as bytes. checked in now... please try
        Hide
        Yug added a comment -

        Works for me with latest svn version of URIUtil. Thanks!

        Show
        Yug added a comment - Works for me with latest svn version of URIUtil. Thanks!

          People

          • Assignee:
            Greg Wilkins
            Reporter:
            Yug
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: