From bed7ade3fa57ef3a7d4e8bd99c35aecb1f414bed Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 16 Mar 2017 12:51:24 +0300 Subject: Fix brep module to properly handle request parameters parsing exceptions --- mod/mod-package-details.cxx | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'mod/mod-package-details.cxx') diff --git a/mod/mod-package-details.cxx b/mod/mod-package-details.cxx index 3a7b31c..b533454 100644 --- a/mod/mod-package-details.cxx +++ b/mod/mod-package-details.cxx @@ -97,21 +97,20 @@ handle (request& rq, response& rs) size_t page (params.page ()); const string& squery (params.query ()); - auto url ( - [&ename](bool f = false, - const string& q = "", - size_t p = 0, - const string& a = "") -> string - { - string s ("?"); - string u (ename); - - if (f) { u += "?f=full"; s = "&"; } - if (!q.empty ()) { u += s + "q=" + mime_url_encode (q); s = "&"; } - if (p > 0) { u += s + "p=" + to_string (p); s = "&"; } - if (!a.empty ()) { u += '#' + a; } - return u; - }); + auto url = [&ename] (bool f = false, + const string& q = "", + size_t p = 0, + const string& a = "") -> string + { + string s ("?"); + string u (ename); + + if (f) { u += "?f=full"; s = "&"; } + if (!q.empty ()) { u += s + "q=" + mime_url_encode (q); s = "&"; } + if (p > 0) { u += s + "p=" + to_string (p); s = "&"; } + if (!a.empty ()) { u += '#' + a; } + return u; + }; xml::serializer s (rs.content (), name); -- cgit v1.1