aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clog.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/clog.c b/src/clog.c
index 67c6b09..4a2d09a 100644
--- a/src/clog.c
+++ b/src/clog.c
@@ -44,10 +44,9 @@ int render_posts_json(struct post_request *);
static void process_md_output(const MD_CHAR *, MD_SIZE size, void *);
static int render_md(const char *, struct kore_buf *);
-static const char *database = "db";
-// FIXME: quotes for JSON error output; extra quotes in HTML
-static const char *req_err = "\"There was an error processing the request.\"";
static const char *accept_json = "application/json";
+static const char *database = "db";
+static const char *req_err = "There was an error processing the request.";
void post_request_init(struct post_request *post_req)
{
@@ -306,10 +305,10 @@ render_posts_json(struct post_request *post_req)
if (err == KORE_RESULT_ERROR)
{
post_req->resp_status = HTTP_STATUS_INTERNAL_ERROR;
- kore_buf_append(
+ kore_buf_appendf(
post_req->resp_buf,
- req_err,
- strlen(req_err)
+ (const char *) asset_error_json,
+ req_err
);
kore_pgsql_logerror(&sql);
goto out;
@@ -343,10 +342,10 @@ render_posts_json(struct post_request *post_req)
if (err == KORE_RESULT_ERROR)
{
post_req->resp_status = HTTP_STATUS_INTERNAL_ERROR;
- kore_buf_append(
+ kore_buf_appendf(
post_req->resp_buf,
- req_err,
- strlen(req_err)
+ (const char *) asset_error_json,
+ req_err
);
kore_pgsql_logerror(&sql);
goto out;