You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Jason Harrop <jh...@bigpond.net.au> on 2001/01/08 13:48:34 UTC

%20 not decoded in copy target

Hi

I have an object at /files/Ror/Intellectual%20Property

The "%20" is actually part of the object name (using the JDBC Reference 
Store):

	mysql> select * from objects;
	+----------------------------------------+------+
	| uri                                    | type |
	+----------------------------------------+------+
	| /                                      |    0 |
	| /files/Ror/Intellectual%20Property   |    0 |
	+----------------------------------------+------+

I created this by using Microsoft Web Folder to create a new directory, 
and then renamed the directory to "Intellectual Property":
	
	978956707348 - MKCOL on object /files/Ror/New Folder
	Mon, 08 Jan 2001 23:25:25 GMT+11:00 - default - INFO - Copy 
/files/Ror/New Folder to /files/Ror/Intellectual%20Property
	Mon, 08 Jan 2001 23:25:25 GMT+11:00 - default - INFO - Copy object : from 
/files/Ror/New Folder to /files/Ror/Intellectual%20Property

I think that this is the problem - the copy operation does not decode 
the %20 in the target name.

So although the object is returned as part of the multistatus response 
if I do propfind on /files/Ror:

	[Slide / ]$  PROPFIND /slide/files/Ror/
	Reopen connection : Host:127.0.0.1 Port:80
	Request: PROPFIND /slide/files/Ror/ HTTP/1.1
	Response: HTTP/1.1 207 Multi-Status
	Status: 207
	<response><href>/slide/files/Ror/Intellectual%20Property</href>&#10;<propstat><prop>....

I get a 404 if i do:

	[Slide / ]$ PROPFIND /slide/files/Ror/Intellectual%20Property
	Request: PROPFIND /slide/files/Ror/Intellectual%20Property HTTP/1.1
	Response: HTTP/1.1 404 Not Found
	Closing connection
	Status: 404

because this is actually decoded to "PROPFIND 
/slide/files/Ror/Intellectual Property"

(FWIW, I get a 501 if I use a space in the webdav cmdline client :
	[Slide / ]$ PROPFIND /slide/files/Corrs/Intellectual Property
	Reopen connection : Host:127.0.0.1 Port:80
	Request: PROPFIND /Property HTTP/1.1
	Response: HTTP/1.1 501 Method PROPFIND is not defined in RFC 2068 and is 
not supported by the Servlet API
	Closing connection
	Status: 501
)

thanks,

Jason


Re: %20 not decoded in copy target

Posted by "Park, Sung-Gu" <je...@thinkfree.com>.
plz, refer to it.

    /*
     * Find any of "%nn" escapes in the string
     * (where nn are hex digits) and convert to the
     * equivalent ASCII character, e.g. "%3f" -> "?"
     * See RFC 1738.
     */
    private String unEscape(String s) {

        String hD = "0123456789abcdef";
        int p2;
        String ns = "";
        int len = s.length();

        for (int p = 0; p < len; p = p2 + 1) {
            p2 = s.indexOf("%", p);
            if (p2 < 0) // not found
                p2 = len;

            ns += s.substring(p, p2);

            if (p2 == len)
                break;

            /*
             * Check for %nn where nn are hex digits
             */
            if (p2 < (len - 2)) {
                int d1 = hD.indexOf(s.toLowerCase().charAt(p2 + 1));
                int d2 = hD.indexOf(s.toLowerCase().charAt(p2 + 2));
                if (d1 > 0 && d2 > 0) {
                    ns += new String(new byte[] {(byte)(d1 << 4 | d2)});
                    p2 += 2;
                    continue;
                }
            }

            ns += "%";
        }

        return ns;
    }

----- Original Message -----
From: "Remy Maucherat" <re...@apache.org>
To: <sl...@jakarta.apache.org>
Sent: Tuesday, January 09, 2001 1:29 AM
Subject: Re: %20 not decoded in copy target


| > Hi
| >
| > I have an object at /files/Ror/Intellectual%20Property
| >
| > The "%20" is actually part of the object name (using the JDBC Reference
| > Store):
| >
| > mysql> select * from objects;
| > +----------------------------------------+------+
| > | uri                                    | type |
| > +----------------------------------------+------+
| > | /                                      |    0 |
| > | /files/Ror/Intellectual%20Property   |    0 |
| > +----------------------------------------+------+
| >
| > I created this by using Microsoft Web Folder to create a new directory,
| > and then renamed the directory to "Intellectual Property":
|
| There is a very similar bug in TC4's WebDAV I found this WE, so perhaps
they
| are related. I'll have a look.
|
| Note : The URI cannot contain spaces. They have to be encoded using the
%xx
| encoding. Of course, the client should do it transaparently.
|
| Thanks,
| Remy
|


Re: %20 not decoded in copy target

Posted by Remy Maucherat <re...@apache.org>.
> Hi
>
> I have an object at /files/Ror/Intellectual%20Property
>
> The "%20" is actually part of the object name (using the JDBC Reference
> Store):
>
> mysql> select * from objects;
> +----------------------------------------+------+
> | uri                                    | type |
> +----------------------------------------+------+
> | /                                      |    0 |
> | /files/Ror/Intellectual%20Property   |    0 |
> +----------------------------------------+------+
>
> I created this by using Microsoft Web Folder to create a new directory,
> and then renamed the directory to "Intellectual Property":

There is a very similar bug in TC4's WebDAV I found this WE, so perhaps they
are related. I'll have a look.

Note : The URI cannot contain spaces. They have to be encoded using the %xx
encoding. Of course, the client should do it transaparently.

Thanks,
Remy