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) { |
+ // 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; |