about summary refs log tree commit diff
path: root/src/libexpr/download.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/download.cc')
-rw-r--r--src/libexpr/download.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libexpr/download.cc b/src/libexpr/download.cc
index e3c6c505c543..18ab6fbcda73 100644
--- a/src/libexpr/download.cc
+++ b/src/libexpr/download.cc
@@ -223,4 +223,13 @@ Path downloadFileCached(const string & url, bool unpack)
 }
 
 
+bool isUri(const string & s)
+{
+    size_t pos = s.find("://");
+    if (pos == string::npos) return false;
+    string scheme(s, 0, pos);
+    return scheme == "http" || scheme == "https";
+}
+
+
 }