aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-27 15:05:16 +0000
committerOmar Polo <op@omarpolo.com>2021-01-27 15:05:16 +0000
commitc4f682f8559b184d64b04aece37d3d2980859832 (patch)
tree44900600164ef998b7663c2cd61eeac082dc35a5 /server.c
parent72bbed91365401d14492dac426401476986c84cf (diff)
trim_req_iri: set error string
Diffstat (limited to 'server.c')
-rw-r--r--server.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/server.c b/server.c
index 1383974..d0e5e4b 100644
--- a/server.c
+++ b/server.c
@@ -308,8 +308,10 @@ handle_open_conn(struct pollfd *fds, struct client *c)
return;
}
- if (!trim_req_iri(c->req) || !parse_iri(c->req, &c->iri, &parse_err)) {
- start_reply(fds, c, BAD_REQUEST, parse_err);
+ if (!trim_req_iri(c->req, &parse_err)
+ || !parse_iri(c->req, &c->iri, &parse_err)) {
+ LOGI(c, "iri parse error: %s", parse_err);
+ start_reply(fds, c, BAD_REQUEST, "invalid request");
return;
}