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

Side by Side Diff: runtime/vm/uri.cc

Issue 2037823003: Make ResolveUri return the correct target_uri for relative base uris. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/uri_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/uri.h" 5 #include "vm/uri.h"
6 6
7 #include "vm/zone.h" 7 #include "vm/zone.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 529
530 } else { 530 } else {
531 // Relative path. We need to merge the base path and the ref path. 531 // Relative path. We need to merge the base path and the ref path.
532 532
533 if (base.scheme == NULL && base.host == NULL && base.path[0] != '/') { 533 if (base.scheme == NULL && base.host == NULL && base.path[0] != '/') {
534 // The dart:core Uri class handles resolving a relative uri 534 // The dart:core Uri class handles resolving a relative uri
535 // against a second relative uri specially, in a way not 535 // against a second relative uri specially, in a way not
536 // described in the RFC. We do not need to support this for 536 // described in the RFC. We do not need to support this for
537 // library resolution. If we need to implement this later, we 537 // library resolution. If we need to implement this later, we
538 // can. 538 // can.
539 *target_uri = NULL;
539 return false; 540 return false;
540 } 541 }
541 542
542 target.scheme = base.scheme; 543 target.scheme = base.scheme;
543 target.userinfo = base.userinfo; 544 target.userinfo = base.userinfo;
544 target.host = base.host; 545 target.host = base.host;
545 target.port = base.port; 546 target.port = base.port;
546 target.path = RemoveDotSegments(MergePaths(base.path, ref.path)); 547 target.path = RemoveDotSegments(MergePaths(base.path, ref.path));
547 target.query = ref.query; 548 target.query = ref.query;
548 target.fragment = ref.fragment; 549 target.fragment = ref.fragment;
549 *target_uri = BuildUri(target); 550 *target_uri = BuildUri(target);
550 return true; 551 return true;
551 } 552 }
552 } 553 }
553 554
554 } // namespace dart 555 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/uri_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698