Don't assert if a query parameter is empty

This commit is contained in:
Jeremy Lakeman 2017-03-22 12:58:06 +10:30
parent cb0b2caa69
commit 88d70fc386
2 changed files with 2 additions and 2 deletions

View File

@ -304,7 +304,7 @@ static int _reserve_str(struct http_request *r, const char **resp, const char *s
static void _mover_www_form_uri_decode(char *, const char *, size_t);
static int _reserve_www_form_uriencoded(struct http_request *r, const char **resp, struct substring str)
{
assert(str.end > str.start);
assert(str.end >= str.start);
const char *after = NULL;
size_t len = www_form_uri_decode(NULL, -1, (char *)str.start, str.end - str.start, &after);
assert(len <= (size_t)(str.end - str.start)); // decoded must not be longer than encoded

View File

@ -137,7 +137,7 @@ test_keyringAdd() {
--output add.json \
--dump-header http.headers \
--basic --user harry:potter \
"http://$addr_localhost:$PORTA/restful/keyring/add"
"http://$addr_localhost:$PORTA/restful/keyring/add?did="
tfw_cat http.headers add.json
tfw_preserve add.json
assertStdoutIs '201'