diff options
Diffstat (limited to 'src/libexpr/download.cc')
-rw-r--r-- | src/libexpr/download.cc | 9 |
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"; +} + + } |