You done found a bug. I reported it as Issue #358. 

org.restlet.util.Template.java (rev 2116) 

1066 
<< final String HEXA = DIGIT + "ABCDEF" 
>> final String HEXA = DIGIT + "ABCDEFabcdef" 

Good catch! 


----- Original Message ----- 
From: "Paul Kaiser" <[EMAIL PROTECTED]> 
To: [email protected] 
Sent: Wednesday, September 5, 2007 9:14:05 PM (GMT-0500) America/New_York 
Subject: Re: Routing and URL decoding 




I don't have much in terms of a restlet-based application. I started looking at 
Restlets about a week ago to build services on top of a legacy database. I took 
the code from the tutorial page (item 11) and dropped it into an empty main() 
method. I've attached the source for your reference. The test results are 

" http://localhost:8182/users/foo%2fbar/orders/aoao " produces "Account of user 
"foo"" 
" http://localhost:8182/users/foo%2Fbar/orders/aoao " produces "Order "aoao" 
for user "foo%2Fbar"". 

I believe the latter is the correct behavior given that "%2F" should not have 
the special meaning that "/" does in a path. 

I haven't had a chance to trace the code to see what is causing the behavior. 
Just that its really odd that case should make a difference. 

Thanks, 
Paul 




----- Original Message ---- 
From: Rob Heittman <[EMAIL PROTECTED]> 
To: [email protected] 
Sent: Wednesday, September 5, 2007 9:52:55 AM 
Subject: Re: Routing and URL decoding 

Been looking for it, but I'm trying to find where the Restlet framework does 
any URL decoding at all ... my apps get a lot of special characters in URIs, 
and we have to decode them explicitly with URLDecoder.decode(...) or 
Reference.decode(...) which wraps it. Restlet's Reference class is pretty 
adamant about not doing any transparent decoding of entities. 
java.net.URLDecoder.decode(...) should support both upper and lowercase hex in 
all compliant JREs. 

Can you say any more about the application? I'd suspect something below the 
Router level. Is it using Restlet-supplied Directory etc. to find some sort of 
static files, or is there custom code for Finders and Resources (or generic 
Restlets doing the same functions). 

----- Original Message ----- 
From: "Paul Kaiser" <[EMAIL PROTECTED]> 
To: "Discuss Restlets" <[email protected]> 
Sent: Tuesday, September 4, 2007 10:10:03 PM (GMT-0500) America/New_York 
Subject: Routing and URL decoding 

I have a "special" situation in an application that allows "/" characters in 
usernames. If I define a URI that include a username as a path element, the 
Router gets confused when presented with a URI with an encoded "/" (%2f); 
something like http://localhost:8182/users/foo%2fbar/orders . Changing it to 
http://localhost:8182/users/foo%2Fbar/orders works, however. 

Is there a reason for the case sensitivity? RFC 1738 suggests that lowercase 
hexadecimal be accepted also. 

I happened on this behavior when typing URIs into a browser. I'm going to look 
at a possible work-around if I need it; probably a custom filter placed ahead 
of the router. If there is a better approach, please let me know. 

Thanks, 
Paul 





____________________________________________________________________________________
 
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for 
today's economy) at Yahoo! Games. 
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow 



Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase. 

Reply via email to