diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-16 12:51:24 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-16 12:51:24 +0300 |
commit | bed7ade3fa57ef3a7d4e8bd99c35aecb1f414bed (patch) | |
tree | ba2158ffeea2e23d7150566bc9773bdbb060ab93 /mod/mod-package-details.cxx | |
parent | f0c834ed57ef3afbbed2a4baacbab19fe6e7a6fd (diff) |
Fix brep module to properly handle request parameters parsing exceptions
Diffstat (limited to 'mod/mod-package-details.cxx')
-rw-r--r-- | mod/mod-package-details.cxx | 29 |
1 files changed, 14 insertions, 15 deletions
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); |