ManifoldCF
  1. ManifoldCF
  2. CONNECTORS-477

Support for full-width space against url

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: ManifoldCF next
    • Component/s: Web connector
    • Labels:
      None

      Description

      When url includes full-width space (" ") MCF can't ingest their documents.

      e.g.
      1.file name
      http://server/site1/Shared%20Documents/test/aaa bbb.txt
      2.path
      http://localhost/aaa bbb/aaa.txt

      MCF's log says:

      WEB: Can't use url '/site1/Shared%20Documents/test/aaa bbb.txt' because it is badly formed: Illegal character in path at index 34: /site1/Shared%20Documents/test/aaa bbb.txt
      

        Activity

        Hide
        Shinichiro Abe added a comment -

        Here is a patch. It can encode full-width space.

        Show
        Shinichiro Abe added a comment - Here is a patch. It can encode full-width space.
        Hide
        Karl Wright added a comment - - edited

        A warning: Trying to crawl SharePoint using the web connector is not going to work for quite a number of reasons. Microsoft is notorious for ignoring web standards in its URLs and has done this in multiple ways in SharePoint. Also, there is no way to accurately "discover" SharePoint documents using the Web Connector. So it is not a good idea to try to make Web Connector into a replacement for the SharePoint connector.

        Show
        Karl Wright added a comment - - edited A warning: Trying to crawl SharePoint using the web connector is not going to work for quite a number of reasons. Microsoft is notorious for ignoring web standards in its URLs and has done this in multiple ways in SharePoint. Also, there is no way to accurately "discover" SharePoint documents using the Web Connector. So it is not a good idea to try to make Web Connector into a replacement for the SharePoint connector.
        Hide
        Karl Wright added a comment - - edited

        About the fix itself: If you can find a document or standard that describes a standard for URL transformation that is not supported by the Web Connector, or you can show that such a transformation works in IE and in Firefox, then we should modify the WebURL class to support this transformation, and others that are similar. I created the WebURL class specifically for the purpose of providing support for URL forms that were unsupported by the Java implementation of URI, which is no longer up-to-date as far as standards are concerned. So, if there was going to be a fix for this issue, I'd recommend that it be done there, and not in WebcrawlerConnector.

        My understanding of how URL encoding was supposed to work was that a URL is encoded in links, NOT by the browser (or crawler). This is necessary because the browser does not typically understand the context within a URL correctly. Now, Microsoft modified that standard by supporting certain transformations within IE, and other browsers have copied those transformations. If there is sufficient support across browsers, we should go ahead and provide a similar feature in the web connector.

        In order to check whether your transformation of full-width space qualifies as feature we should support, you would want to create a website locally (running under IIS probably), which has documents with names that include problematic characters such as full-width space. Then, also create a page that has links to these documents, in the form <a href="...">...</a>, where the full-width space character is NOT properly URL encoded but is exposed. Browse to the link page and click on the link. Does the browser load the expected document, or not? Which browsers work, and which do not? If it does seem to be supported, are there other characters that work the same, or not?

        Show
        Karl Wright added a comment - - edited About the fix itself: If you can find a document or standard that describes a standard for URL transformation that is not supported by the Web Connector, or you can show that such a transformation works in IE and in Firefox, then we should modify the WebURL class to support this transformation, and others that are similar. I created the WebURL class specifically for the purpose of providing support for URL forms that were unsupported by the Java implementation of URI, which is no longer up-to-date as far as standards are concerned. So, if there was going to be a fix for this issue, I'd recommend that it be done there, and not in WebcrawlerConnector. My understanding of how URL encoding was supposed to work was that a URL is encoded in links, NOT by the browser (or crawler). This is necessary because the browser does not typically understand the context within a URL correctly. Now, Microsoft modified that standard by supporting certain transformations within IE, and other browsers have copied those transformations. If there is sufficient support across browsers, we should go ahead and provide a similar feature in the web connector. In order to check whether your transformation of full-width space qualifies as feature we should support, you would want to create a website locally (running under IIS probably), which has documents with names that include problematic characters such as full-width space. Then, also create a page that has links to these documents, in the form <a href="...">...</a>, where the full-width space character is NOT properly URL encoded but is exposed. Browse to the link page and click on the link. Does the browser load the expected document, or not? Which browsers work, and which do not? If it does seem to be supported, are there other characters that work the same, or not?
        Hide
        Shinichiro Abe added a comment -

        So it is not a good idea to try to make Web Connector into a replacement for the SharePoint connector.

        I think so, too.

        But there are the sites which have improperly encoded URL links in Japan.
        I want to support this on webconnector but I'm thinking of better solution for a while.
        I want to convert the urls which java.net.URI.URI class doesn't support, e.g.harf-width space, full-width, <, >, and so on. It may take more time to look into.

        Show
        Shinichiro Abe added a comment - So it is not a good idea to try to make Web Connector into a replacement for the SharePoint connector. I think so, too. But there are the sites which have improperly encoded URL links in Japan. I want to support this on webconnector but I'm thinking of better solution for a while. I want to convert the urls which java.net.URI.URI class doesn't support, e.g.harf-width space, full-width, <, >, and so on. It may take more time to look into.
        Hide
        Karl Wright added a comment -

        But there are the sites which have improperly encoded URL links in Japan.

        I want to support this on webconnector but I'm thinking of better solution for a while.

        I agree, especially where there are browsers that accept the bad URLs. We have to have something to evaluate our code against, to emulate. And, the changes should go in the org.apache.manifoldcf.crawler.connectors.webconnector.WebURL class.

        Show
        Karl Wright added a comment - But there are the sites which have improperly encoded URL links in Japan. I want to support this on webconnector but I'm thinking of better solution for a while. I agree, especially where there are browsers that accept the bad URLs. We have to have something to evaluate our code against, to emulate. And, the changes should go in the org.apache.manifoldcf.crawler.connectors.webconnector.WebURL class.
        Hide
        Karl Wright added a comment -

        Hi Abe-san,

        This issue has been open for a very long time. What was the resolution for it? Is this ever going to happen?

        Show
        Karl Wright added a comment - Hi Abe-san, This issue has been open for a very long time. What was the resolution for it? Is this ever going to happen?
        Hide
        Shinichiro Abe added a comment -

        The URL including full-width space is in a special case, so I will not fix this.

        Show
        Shinichiro Abe added a comment - The URL including full-width space is in a special case, so I will not fix this.

          People

          • Assignee:
            Shinichiro Abe
            Reporter:
            Shinichiro Abe
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development