data: URL requests should serve the whole decoded URL
authorZan Dobersek <zandobersek@gmail.com>
Thu, 7 Mar 2013 20:23:15 +0000 (21:23 +0100)
committerSergio Villar Senin <svillar@igalia.com>
Mon, 11 Mar 2013 16:08:19 +0000 (17:08 +0100)
commitc1c58c9fc79562b0da4ceeeb3fc378407f8b9c85
treea85fa722c611a3bb0db7b0edcdaf872abfac85ba
parent61d321fa2cfb1ffb34a7c9fc151287c271b4cca4
data: URL requests should serve the whole decoded URL

Address the possibility of data: URLs containing null characters when the data
request is being performed. The uri_decoded_copy method is enhanced with a
third argument, a pointer to an integer that should be set to the length of
decoded data when provided. This length is then set as the request's content
length.

A test checking the correct behavior is added in requester-test. Calls to
uri_decoded_copy where the length of the decoded output is not required are
adjusted to provide NULL as the third argument.
libsoup/soup-misc-private.h
libsoup/soup-request-data.c
libsoup/soup-uri.c
tests/requester-test.c