From 2667fad8bf6e7ef6ef1894ab49a3bdc5cc858607 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 14 Nov 2018 22:19:50 +0300 Subject: Add support for repository location compound schemes (git+https, etc) --- mod/mod-ci.cxx | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'mod/mod-ci.cxx') diff --git a/mod/mod-ci.cxx b/mod/mod-ci.cxx index e16a1a1..e0b35dd 100644 --- a/mod/mod-ci.cxx +++ b/mod/mod-ci.cxx @@ -222,23 +222,12 @@ handle (request& rq, response& rs) return true; } - // Parse and verify the remote repository location. + // Verify the remote repository location. // - repository_location rl; + const repository_location rl (params.repository ()); - try - { - const repository_url& u (params.repository ()); - - if (u.empty () || u.scheme == repository_protocol::file) - throw invalid_argument (""); - - rl = repository_location (u, guess_type (u, false /* local */)); - } - catch (const invalid_argument&) - { + if (rl.empty () || rl.local ()) return respond_manifest (400, "invalid repository location"); - } // Verify the package name[/version] arguments. // -- cgit v1.1