mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-29 15:43:56 +00:00
Don't assert if a query parameter is empty
This commit is contained in:
parent
cb0b2caa69
commit
88d70fc386
@ -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
|
||||
|
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user