@nacx the reason for the change in Uris.java is the current behavior of 
```appendPath()```: decode the path and then call ```path()``` with the decoded 
string (possibly, prepending a "/" character). ```path()``` then, in turn, 
_also_ decodes the string (as you pointed out). That leads to a string that is 
decoded twice. I couldn't figure out the original intent of whoever introduced 
such behavior, but it doesn't seem right to me.

Here is an example that breaks with this today: appending a path of the form 
"%24$" (%24 is $), which is encoded "%2524%24". When passing this value to 
```appendPath()``` it is then decoded as "%24$", but when we decode it one more 
time we end up with " $$", which is not the original path. We then generate a 
URI with the appended path being _%24%24_ I think making this change to 
```appendPath()``` makes sense, but I might be missing something. This was 
turned up when I attempted to put and get a blob named "%20 " (and " %20").

I looked at where ```@EndpointParam``` is used and it looks like EC2 is a 
pretty heavy user of this. I'm going to run all of the live EC2 tests and 
report back with results. I looked at what it does and it's not clear to me 
where there would be a problem with its usage. Could you elaborate further what 
this PR makes incorrect or difficult?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/851#issuecomment-137338082

Reply via email to