hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlo Bertoldi <carlo.berto...@ubiquity.it>
Subject Double encoding problem with URIBuilder
Date Fri, 30 Nov 2012 16:52:23 GMT
Hello, I'm using Httpclient 4.2,
  and I think I've found a bug in the URIBuilder.

This is the toString of an URIBuilder object:

URI [scheme=http, userInfo=null, host=127.0.0.1, port=9091, 
path=/changeMsisdn.jsp, queryParams=[OldMsisdn, 
NewMsisdn=+393473334570], fragment=null]

Look at the NewMsisdn parameter, now let's convert it to an URL with the 
URIBuilder:
URL url = builder.build().toURL();

This is the URL I get:
http://127.0.0.1:9091/changeMsisdn.jsp?OldMsisdn&NewMsisdn=%252B393473334570

Clearly the number should have been %2B393473334570 but the % sign is 
encoded once more to %25.

Cheers,
  Carlo



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message