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

Unified Diff: url/url_canon_relative.cc

Issue 1409293007: new URL('') should throw TypeError (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comments Created 5 years, 1 month 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 | « third_party/WebKit/LayoutTests/platform/win/fast/url/segments-from-data-url-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_canon_relative.cc
diff --git a/url/url_canon_relative.cc b/url/url_canon_relative.cc
index c2e94e418529dd6cde73f2c6a92c225405eb4150..e34ea2fa2495dc6acbb301644dca4b04b3738762 100644
--- a/url/url_canon_relative.cc
+++ b/url/url_canon_relative.cc
@@ -75,6 +75,10 @@ bool DoIsRelativeURL(const char* base,
TrimURL(url, &begin, &url_len);
if (begin >= url_len) {
// Empty URLs are relative, but do nothing.
+ if (!is_base_hierarchical) {
brettw 2015/11/30 17:46:18 We should get a test for this case in url_canon_un
ramya.v 2015/12/01 07:37:03 Done.
+ // Don't allow relative URLs if the base scheme doesn't support it.
+ return false;
+ }
*relative_component = Component(begin, 0);
*is_relative = true;
return true;
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/fast/url/segments-from-data-url-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698