Skip to content

Commit

Permalink
Strip trailing & in post data
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Mar 17, 2014
1 parent 04429a7 commit 25c81aa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/modules/rlm_rest/rest.c
Expand Up @@ -517,13 +517,19 @@ static size_t rest_encode_post(void *ptr, size_t size, size_t nmemb, void *userd
s -= len;

if (!--s) goto no_space;
*p++ = '&';


/*
* We wrote one full attribute value pair, record progress.
*/
f = p;
fr_cursor_next(&ctx->cursor);

/*
* there are more attributes, insert a separator
*/
if (fr_cursor_next(&ctx->cursor)) {
*p++ = '&';
}
ctx->state = READ_STATE_ATTR_BEGIN;
}

Expand Down

0 comments on commit 25c81aa

Please sign in to comment.