You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Eli Collins (JIRA)" <ji...@apache.org> on 2011/08/08 06:33:27 UTC

[jira] [Commented] (HDFS-2235) Hftp doesn't support paths with semicolons

    [ https://issues.apache.org/jira/browse/HDFS-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080738#comment-13080738 ] 

Eli Collins commented on HDFS-2235:
-----------------------------------

The bug is that HttpServletRequest#getPathInfo in jetty (and other popular servlet implementations, see [1]) don't consider semicolons and the characters that follow before the query fragment as part of the path for some reason. Eg for "foo;bar?a=b" getPathInfo returns "foo" rather than "foo;bar".

One workaround is to use getRequestURI which will return "foo;bar", but unlike getPathInfo the result is not decoded, therefore the parts of the path that need encoding (eg contain spaces) and get encoded when the URI object is created will not get decoded. URL decoding the value  getRequestURI returns doesn't work however because it will decode paths that contain reserved URI characters (eg will decode "+" into a space) - the decoding needs to be the same path decoding that eg jetty would perform [2], ie doesn't decode reserved characters.

A suggestion from Todd is to encode the path used when creating the URL. Eg URL encode each individual segment of the path when creating the "/data" URL, and then decode each segment when retrieving the path with getPathInfo.

1. http://cdivilly.wordpress.com/2011/04
2. http://jetty.codehaus.org/jetty/jetty-6/xref/org/mortbay/util/URIUtil.html

> Hftp doesn't support paths with semicolons
> ------------------------------------------
>
>                 Key: HDFS-2235
>                 URL: https://issues.apache.org/jira/browse/HDFS-2235
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.23.0
>            Reporter: Eli Collins
>             Fix For: 0.23.0
>
>
> Hftp does not support paths which contain semicolons. The commented out test in HDFS-2234 illustrates this.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira