summaryrefslogtreecommitdiff
path: root/src/machine/machinectl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-08-19 18:15:37 +0200
committerLennart Poettering <lennart@poettering.net>2021-08-20 21:56:39 +0200
commitc456862f87237831ce2bbaeb53a37d1b3d669285 (patch)
tree763c4d08764dae35c15b6c8f27b89cd1ff63efd4 /src/machine/machinectl.c
parent55b90ee00b78a449c8f187a5e8141f8ccb100bf4 (diff)
downloadsystemd-c456862f87237831ce2bbaeb53a37d1b3d669285.tar.gz
import: allow file:// in addition to HTTP(S)
Previously we only allows http/https urls, let's open this up a bit. Why? Because it makes testing *so* *much* *easier* as we don't need to run a HTTP server all the time. CURL mostly abstracts the differences of http/https away from us, hence we can get away with very little extra work.
Diffstat (limited to 'src/machine/machinectl.c')
-rw-r--r--src/machine/machinectl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 3f4ad87897..c3a2384f15 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -2125,7 +2125,7 @@ static int pull_tar(int argc, char *argv[], void *userdata) {
assert(bus);
remote = argv[1];
- if (!http_url_is_valid(remote))
+ if (!http_url_is_valid(remote) && !file_url_is_valid(remote))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"URL '%s' is not valid.", remote);
@@ -2181,7 +2181,7 @@ static int pull_raw(int argc, char *argv[], void *userdata) {
assert(bus);
remote = argv[1];
- if (!http_url_is_valid(remote))
+ if (!http_url_is_valid(remote) && !file_url_is_valid(remote))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"URL '%s' is not valid.", remote);