Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(922)

Unified Diff: sdk/lib/io/http_impl.dart

Issue 337033003: Revert "New, more validating, parser for URI." and follow-up patches. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/core/uri.dart ('k') | tests/co19/co19-co19.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index 3e1a059dd6cced6087e766aae6a8e033597f10a3..f9fedc3410bf898fec9521989910eeef3ea6c366 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1674,34 +1674,10 @@ class _HttpClient implements HttpClient {
String host,
int port,
String path) {
- const int _NUMBER_SIGN = 0x23;
- const int _QUESTION = 0x3F;
- String pathOnly = path;
- String query;
- String fragment;
- // TODO(lrn): Consider dropping the fragment from the Uri.
- for (int i = 0; i < path.length; i++) {
- int char = path.codeUnitAt(i);
- if (char == _NUMBER_SIGN) {
- pathOnly = path.substring(0, i);
- fragment = path.substring(i + 1);
- break;
- }
- if (char == _QUESTION) {
- pathOnly = path.substring(0, i);
- int queryEnd = path.length;
- int fragmentStart = path.indexOf("#", i + 1);
- if (fragmentStart >= 0) {
- queryEnd = fragmentStart;
- fragment = path.substring(fragmentStart + 1);
- }
- query = path.substring(i + 1, queryEnd);
- break;
- }
- }
+ // TODO(sgjesse): The path set here can contain both query and
+ // fragment. They should be cracked and set correctly.
return _openUrl(method, new Uri(
- scheme: "http", host: host, port: port, path: pathOnly,
- query: query, fragment: fragment));
+ scheme: "http", host: host, port: port, path: path));
}
Future<HttpClientRequest> openUrl(String method, Uri url) {
« no previous file with comments | « sdk/lib/core/uri.dart ('k') | tests/co19/co19-co19.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698