Permalink
Browse files

Fix URL generation error when first parameter is specified multiple t…

…imes.
  • Loading branch information...
1 parent e195f92 commit eef8eb06c5cce316d0d482462e992553e4627822 Ryan Morgan committed May 24, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/org/hyperic/hq/hqapi1/HQConnection.java
@@ -149,12 +149,15 @@ private String urlEncode(String s)
for (Iterator i = params.keySet().iterator(); i.hasNext(); idx++) {
String key = (String)i.next();
String[] vals = params.get(key);
+ boolean append = false;
+
for (String val : vals) {
if (val != null) {
- if (idx > 0) {
+ if (append) {
uri.append("&");
}
uri.append(key).append("=").append(urlEncode(val));
+ append = true;
}
}
}

0 comments on commit eef8eb0

Please sign in to comment.