jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Kopp <kopp...@gmail.com>
Subject Decoding of key names
Date Wed, 22 May 2013 08:33:39 GMT
Hey,

I'm trying to create a bucket with following name

http%253A%252F%252Fwww.example.org
%252Fwinery%252Ftest%252Fjclouds/test/test.properties

That should result in the path

http%253A%252F%252Fwww.example.org%252Fwinery%252Ftest%252Fjclouds / test /
test.properties

or

http%3A%2F%2Fwww.example.org%2Fwinery%2Ftest%2Fjclouds / test /
test.properties

I would assume that NO decoding is done, but one decoding would be
understandable.

The issue is that the path created is

http: / / www.example.org / winery / test / jclouds / test / test.properties

It seems that a decoder runs somewhere and decodes until no "%" sign is
found. This seems to be similar to an issue in old commons-io code.
(See https://issues.apache.org/jira/browse/CONFIGURATION-521 for a similar
issue)

I tried to track down the issue.
However, org.jclouds.http.HttpCommand getCurrentRequest() returns the
decoded string, whereas toString() returns the original (encoded) string.
That makes debugging really difficult.

It might have something to do with

unescapeSpecialChars(uri.getPath())
in line 284 of org.jclouds.http.URI

It is called multiple times before a URI is really used.

My current solution is to encode the % sign *three* times, do reverse the
effect of the unescaping.

Cheers,

Oliver

Mime
View raw message