]> granicus.if.org Git - libevent/commit
New evhttp_uri(encode|decode) functions to handle + and NUL characters right
authorNick Mathewson <nickm@torproject.org>
Fri, 8 Oct 2010 17:05:13 +0000 (13:05 -0400)
committerNick Mathewson <nickm@torproject.org>
Sat, 9 Oct 2010 03:58:00 +0000 (23:58 -0400)
commita8148cedcd4cbff429cbe60e31ee084d236ccc43
treec126abfa0428d97f3e9dbb58a12bdf3626e0ddc3
parent2e63a604da3f3c77800d2a2ff1681d8397ecdac6
New evhttp_uri(encode|decode) functions to handle + and NUL characters right

The old evhttp_decode_uri() function would act as tough it was doing
an (illegal, undefined) decode operation on a whole URL at once, and
treat + characters following a ? as different from + characters
preceding one.  But that's not useful: If you are decoding a URI
before splitting off query parameters, you are begging to fail as soon
as somebody gives you a value with an encoded & in it.

The new evhttp_uridecode() function takes an argument that says
whether to decode + signs.  Both uridecode and uriencode also now
support encoding or decoding to strings with internal 0-valued
characters.
http.c
include/event2/http.h
test/regress_http.c