diff options
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/import-raw.c | 15 | ||||
-rw-r--r-- | src/import/import-raw.h | 2 | ||||
-rw-r--r-- | src/import/import.c | 2 |
3 files changed, 3 insertions, 16 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c index 80fdbb7781..486157aa96 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -28,9 +28,9 @@ #include "utf8.h" #include "curl-util.h" #include "qcow2-util.h" -#include "import-raw.h" #include "strv.h" #include "copy.h" +#include "import-raw.h" typedef struct RawImportFile RawImportFile; @@ -904,7 +904,7 @@ int raw_import_pull(RawImport *import, const char *url, const char *local, bool int r; assert(import); - assert(raw_url_is_valid(url)); + assert(http_url_is_valid(url)); assert(!local || machine_name_is_valid(local)); if (hashmap_get(import->files, url)) @@ -949,14 +949,3 @@ int raw_import_pull(RawImport *import, const char *url, const char *local, bool f = NULL; return 0; } - -bool raw_url_is_valid(const char *url) { - if (isempty(url)) - return false; - - if (!startswith(url, "http://") && - !startswith(url, "https://")) - return false; - - return ascii_is_valid(url); -} diff --git a/src/import/import-raw.h b/src/import/import-raw.h index a423ec0187..17f7a1a8ee 100644 --- a/src/import/import-raw.h +++ b/src/import/import-raw.h @@ -33,5 +33,3 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(RawImport*, raw_import_unref); int raw_import_pull(RawImport *import, const char *url, const char *local, bool force_local); int raw_import_cancel(RawImport *import, const char *name); - -bool raw_url_is_valid(const char *url); diff --git a/src/import/import.c b/src/import/import.c index af8d0ec42b..9b10de5559 100644 --- a/src/import/import.c +++ b/src/import/import.c @@ -90,7 +90,7 @@ static int pull_raw(int argc, char *argv[], void *userdata) { int r; url = argv[1]; - if (!raw_url_is_valid(url)) { + if (!http_url_is_valid(url)) { log_error("URL '%s' is not valid.", url); return -EINVAL; } |