aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-02-22 19:48:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-02-25 13:15:10 +0300
commitc35f1af6095a4fefa7f0e742eac565133abc141d (patch)
tree43c218806097fcf44bcdb7d122883a701eccf221 /mod
parentfd999f9d61fbc07d77801fe3695fbf16ac9c3a9c (diff)
Add UTF-8 error details to CI and submit service responces
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-ci.cxx7
-rw-r--r--mod/mod-submit.cxx7
2 files changed, 10 insertions, 4 deletions
diff --git a/mod/mod-ci.cxx b/mod/mod-ci.cxx
index 42a38ca..77377eb 100644
--- a/mod/mod-ci.cxx
+++ b/mod/mod-ci.cxx
@@ -268,10 +268,13 @@ handle (request& rq, response& rs)
//
// Actually, the expected ones must satisfy too, so check them as well.
//
+ string what;
for (const name_value& nv: rps)
{
- if (nv.value && !utf8 (*nv.value, codepoint_types::graphic, U"\r\n\t"))
- return respond_manifest (400, "invalid parameter " + nv.name);
+ if (nv.value &&
+ !utf8 (*nv.value, what, codepoint_types::graphic, U"\n\r\t"))
+ return respond_manifest (400,
+ "invalid parameter " + nv.name + ": " + what);
}
// Parse and validate overrides, if present.
diff --git a/mod/mod-submit.cxx b/mod/mod-submit.cxx
index ce36a19..0dea2b7 100644
--- a/mod/mod-submit.cxx
+++ b/mod/mod-submit.cxx
@@ -257,10 +257,13 @@ handle (request& rq, response& rs)
//
// Actually, the expected ones must satisfy too, so check them as well.
//
+ string what;
for (const name_value& nv: rps)
{
- if (nv.value && !utf8 (*nv.value, codepoint_types::graphic, U"\r\n\t"))
- return respond_manifest (400, "invalid parameter " + nv.name);
+ if (nv.value &&
+ !utf8 (*nv.value, what, codepoint_types::graphic, U"\n\r\t"))
+ return respond_manifest (400,
+ "invalid parameter " + nv.name + ": " + what);
}
// Note that from now on the result manifest we respond with will contain