justeat-robert / oauth-signpost

Automatically exported from code.google.com/p/oauth-signpost
0 stars 0 forks source link

URL query parameter without values causes failure #73

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In which environment did the problem appear?
- Android

What steps will reproduce the problem?
1. Use an URL like "http://example.com/aPath?aParameter

Usage of such an URL generates a wrong SBS, the "aParameter" part is missing.

This is due to AbstractAOuthConsumer.collectQueryParameter(...) creating a 
HttpParameters map with a key="aParameter" and value=null. This map is now 
added to the "global" HttpParameters map using the putApp method with 
percentEncode=true. This results in a call to "public SortedSet<String> 
put(String key, SortedSet<String> values, boolean percentEncode)" with still 
percentEncode=true. Here a loop is done over the values set, which is null 
here. So the parameter is not added to the map and simply ignored.

Original issue reported on code.google.com by j.ko...@seeburger.de on 28 Mar 2013 at 12:11

GoogleCodeExporter commented 8 years ago
A workaround dis to patch the URL and add an = sign.

http://example.com/aPath?aParameter=

Original comment by j.ko...@seeburger.de on 28 Mar 2013 at 12:19