From 89aefec026c8288e3f7ed9e0a05cdbc12f2684d9 Mon Sep 17 00:00:00 2001 From: Andrei Savu Date: Wed, 14 Mar 2012 18:03:08 +0200 Subject: [PATCH] Decode both the key and the value when parsing the request URI --- .../cloudstack/features/VirtualMachineClientLiveTest.java | 4 +--- core/src/main/java/org/jclouds/http/utils/ModifyRequest.java | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/VirtualMachineClientLiveTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/VirtualMachineClientLiveTest.java index 7558d13b3c..350d5a162e 100644 --- a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/VirtualMachineClientLiveTest.java +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/VirtualMachineClientLiveTest.java @@ -231,9 +231,7 @@ public class VirtualMachineClientLiveTest extends BaseCloudStackClientLiveTest { @Override public boolean apply(@Nullable Network network) { return network.isDefault() && - network.getGuestIPType() == GuestIPType.VIRTUAL && - network.getNetworkOfferingId() == 6 && - network.getId() == 204; + network.getGuestIPType() == GuestIPType.VIRTUAL; } })); logger.info("Required network: " + requiredNetwork); diff --git a/core/src/main/java/org/jclouds/http/utils/ModifyRequest.java b/core/src/main/java/org/jclouds/http/utils/ModifyRequest.java index 7dc82f3da4..76c830931b 100644 --- a/core/src/main/java/org/jclouds/http/utils/ModifyRequest.java +++ b/core/src/main/java/org/jclouds/http/utils/ModifyRequest.java @@ -170,7 +170,7 @@ public class ModifyRequest { int indexOfFirstEquals = stringToParse.indexOf('='); String key = indexOfFirstEquals == -1 ? stringToParse : stringToParse.substring(0, indexOfFirstEquals); String value = indexOfFirstEquals == -1 ? null : stringToParse.substring(indexOfFirstEquals + 1); - map.put(key, Strings2.urlDecode(value)); + map.put(Strings2.urlDecode(key), Strings2.urlDecode(value)); } public static String makeQueryLine(Multimap params,