Chromium Code Reviews| Index: sdk/lib/core/uri.dart |
| diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart |
| index c8277e7fc6b4b035ad7624e195049d0817a80740..d3ae2e16868e18caa41ab88efef408498b653c92 100644 |
| --- a/sdk/lib/core/uri.dart |
| +++ b/sdk/lib/core/uri.dart |
| @@ -183,7 +183,7 @@ class Uri { |
| return query.split("&").fold({}, (map, element) { |
| int index = element.indexOf("="); |
| if (index == -1) { |
| - if (!element.isEmpty) map[element] = ""; |
| + if (!element.isEmpty) map[decodeQueryComponent(element)] = ""; |
| } else if (index != 0) { |
| var key = element.substring(0, index); |
| var value = element.substring(index + 1); |
| @@ -310,17 +310,18 @@ class Uri { |
| int length = component.length; |
| int index = 0; |
| int prevIndex = 0; |
| - while (index < length) { |
| - // Copy a part of the component string to the result. |
| - fillResult() { |
| - if (result == null) { |
| - assert(prevIndex == 0); |
| - result = new StringBuffer(component.substring(prevIndex, index)); |
| - } else { |
| - result.write(component.substring(prevIndex, index)); |
| - } |
| + // Copy a part of the component string to the result. |
| + fillResult() { |
|
Lasse Reichstein Nielsen
2013/06/03 07:56:47
void return type.
Makes it more obvious that this
Søren Gjesse
2013/06/03 09:35:41
Done.
|
| + if (result == null) { |
| + assert(prevIndex == 0); |
| + result = new StringBuffer(component.substring(prevIndex, index)); |
| + } else { |
| + result.write(component.substring(prevIndex, index)); |
| } |
| + } |
| + |
| + while (index < length) { |
| // Normalize percent encoding to uppercase and don't encode |
| // unreserved characters. |
| @@ -353,6 +354,7 @@ class Uri { |
| index++; |
| } |
| } |
| + if (result != null && prevIndex != index) fillResult(); |
| assert(index == length); |
| if (result == null) return component; |