portals-portalapps-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Woonsan Ko (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (APA-47) Reverse Proxy Service Component needs to encode remote URLs which are malformed (e.g., containing space)
Date Wed, 18 Jan 2012 05:28:39 GMT

    [ https://issues.apache.org/jira/browse/APA-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188280#comment-13188280

Woonsan Ko commented on APA-47:


Now, by default, spaces in the invoking URI are replaced by '%20's before invoking HTTP Client
Also, the default URI Cleaner component can be configured like the following:

    # Invoking URI Cleaner used to clean remote URI just before invoking HTTP Client Methods
    proxy.http.client.default.uri.cleaner = org.apache.portals.applications.webcontent.proxy.impl.DefaultURICleanerImpl
    # The default URI Cleaner replaces spaces by '%20'. You may add additional searchList/replacementList
    proxy.http.client.default.uri.cleaner.param.searchList = \u005E
    proxy.http.client.default.uri.cleaner.param.replacementList = %5E

So, if there are anythings more to escape, the configuration can be added as comma separated.
For example, the configuration above is adding '^' which should be replaced by '%5E'.

Also, the URI Cleaner component can be replaced by a custom implementation, properties of
which can be configured with 'proxy.http.client.default.uri.cleaner.param.*' properties.
> Reverse Proxy Service Component needs to encode remote URLs which are malformed (e.g.,
containing space)
> --------------------------------------------------------------------------------------------------------
>                 Key: APA-47
>                 URL: https://issues.apache.org/jira/browse/APA-47
>             Project: Portals Apps
>          Issue Type: Bug
>            Reporter: Woonsan Ko
>            Assignee: Woonsan Ko
>             Fix For: apa-webcontent-1.2
> Thank you so much for reporting this problem, Jérôme Dupont!
> Excerpt from the thread in the mailinglist:
> -------
> I have a problem left, it's that some uri of documents are malformed and
> contain space, and webcontent proxyx (I use the 1.1 version) doesn't encode
> them with the default configuration.
> Is there a mean to encode the url before parsing it?
> here is the return exception
> java.lang.IllegalArgumentException
>     java.net.URI.create(URI.java:842)
>     org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:69)
> org.apache.portals.applications.webcontent.proxy.impl.RewritableHttpReverseProxyServiceImpl.invoke
> (RewritableHttpReverseProxyServiceImpl.java:289)
> org.apache.portals.applications.webcontent.proxy.impl.DefaultHttpReverseProxyServlet.service
> (DefaultHttpReverseProxyServlet.java:436)
>     javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> cause m�re
> java.net.URISyntaxException: Illegal character in path at index 108:
> http://SECRETSERVER.bnf.fr/DSI/PiloteProdV6.nsf/0/F8C57293124EDBF9C125783200376835/$FILE/EXO-ADM-2011-000020-01
> (p2).doc
>     java.net.URI$Parser.fail(URI.java:2809)
>     java.net.URI$Parser.checkChars(URI.java:2982)
>     java.net.URI$Parser.parseHierarchical(URI.java:3066)
>     java.net.URI$Parser.parse(URI.java:3014)
>     java.net.URI.<init>(URI.java:578)
>     java.net.URI.create(URI.java:840)
>     org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:69)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message