diff options
Diffstat (limited to 'mod/mod-build-force.cxx')
-rw-r--r-- | mod/mod-build-force.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mod/mod-build-force.cxx b/mod/mod-build-force.cxx index da063ea..af47b4c 100644 --- a/mod/mod-build-force.cxx +++ b/mod/mod-build-force.cxx @@ -77,10 +77,16 @@ handle (request& rq, response& rs) try { - string& p (params.package ()); + package_name p; - if (p.empty ()) - throw invalid_argument ("empty package name"); + try + { + p = package_name (move (params.package ())); + } + catch (const invalid_argument& e) + { + throw invalid_argument (string ("invalid package name: ") + e.what ()); + } // We accept the non-url-encoded version representation. Note that the // parameter is already url-decoded by the web server, so we just restore |