summaryrefslogtreecommitdiff
path: root/tests/uri-parsing.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: add data: URI tests to uri-parsingDan Winship2014-07-211-0/+67
|
* tests: use g_test_bug() to annotate test casesDan Winship2014-03-151-69/+79
|
* tests: initial port to the gtestutils frameworkDan Winship2014-02-081-251/+114
| | | | | Some programs need to be split up into more tests, and the debug output is mostly not updated for the new format.
* More IPv6 scope ID fixesDan Winship2013-08-191-0/+8
| | | | | | | Don't include the scope ID in the "Host" header. Make SoupURI correctly parse both correct and incorrect scope IDs, and add checks for that in tests/uri-parsing.
* soup-uri: fix URI scheme parsingDan Winship2013-07-131-0/+16
| | | | | | | The URI grammar allows a scheme to have digits in it after the first character, and doesn't allow [.+-] in the first character. https://bugzilla.gnome.org/show_bug.cgi?id=703776
* Revert "SoupURI: replace NULL password with "" on http"Dan Winship2013-01-211-6/+6
| | | | | | | | | | This broke CalDAV in evolution. I'm not sure exactly why, but if it broke that, it might break other things too, so let's just revert this. This reverts commit 38901ca5e684a8fac75e6ff740d45c82dd44181a. https://bugzilla.gnome.org/show_bug.cgi?id=692149
* SoupURI: replace NULL password with "" on httpDan Winship2013-01-121-6/+6
| | | | | All supported HTTP auth methods use both username and password, so assume a password of "" if none is given
* soup-uri: don't decode %00 in URIsDan Winship2012-12-101-0/+3
| | | | | We were accidentally decoding %00 to '\0' in URIs, causing a few WebKit tests to fail. Leave it undecoded instead.
* tests/uri-parsing: check empty username/passwordDan Winship2012-12-091-0/+5
| | | | | Make sure that zero-length username/password are recognized as different from no username/password.
* soup_uri_normalize: more fixesDan Winship2012-07-171-0/+48
| | | | | | | | | uri_normalized_copy() should not go into fixup mode when it sees a non-printable character if that character is in @unescape_extra. Likewise, if it does go into fixup mode, it shouldn't fix up the @unescape_extra characters. https://bugzilla.gnome.org/show_bug.cgi?id=680018
* Clean up includesDan Winship2012-07-131-12/+4
| | | | | | | | Especially, include soup.h rather than individually including a bunch of other public soup-*.h files. Remove unnecessary system includes (many are leftovers from code that has moved down into glib).
* SoupURI: fix fallback handling of soup_uri_set_path(uri, NULL)Dan Winship2012-02-251-1/+51
| | | | | | | | In the old code, if you set a URI's path to NULL and then did soup_uri_to_string(uri, FALSE), you'd get back a path of "/". Fix the new code to behave the same way (and test it). https://bugzilla.gnome.org/show_bug.cgi?id=670431
* soup-uri: revert some of the previously-added return-if-failsDan Winship2012-02-101-0/+102
| | | | | | | | | | | | | | | | | | Although it has always been documented that a SoupURI must have a non-NULL path, nothing ever enforced this, and most methods checked whether it was NULL before looking at it anyway. So lots of existing code was getting this wrong, and is now breaking because of the "g_return_if_fail (SOUP_URI_IS_VALID (uri))" checks. So, change most of those to just g_warn_if_fail() (while adding back the old return-if-fail !NULL checks), but also fix soup_uri_set_path() and soup_uri_new_with_base() to handle NULL paths more sanely (after warning). Also, allow calling the getters on invalid URIs. Add a new test to uri-testing to make sure that URIs created with soup_uri_new(NULL) behave as expected at each step of the way... https://bugzilla.gnome.org/show_bug.cgi?id=667637
* uri-parsing test: add a case that was exercised by a protocol fuzzerSimon McVittie2012-02-031-0/+3
| | | | | | | | | This was suspected to cause a crash via a NULL path; while it seems it doesn't actually have that problem, it still seems worth testing. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637 Bug-NB: NB#294977 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* uri-parsing test: verify that URIs are split correctlySimon McVittie2012-02-031-89/+243
| | | | | | | | | Testing the round-trip (split + reassemble) is necessary, but not sufficient: a large proportion of SoupURI's API is in terms of the separate parts, and this was never explicitly tested before. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* soup-uri: %-encode non-ASCII characters when parsing URIsDan Winship2011-11-121-1/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=662806
* Do not uppercase percent-encoded triplets when normalizing URIsSergio Villar Senin2010-09-031-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=628728
* [SoupURI] additional fixes to previous commitDan Winship2010-02-141-0/+2
|
* [SoupURI] tolerate bad %-encoding and other common sorts of URI lossageDan Winship2010-02-141-6/+15
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=590524
* SoupURI: an empty query is distinct from no queryDan Winship2009-09-071-1/+5
| | | | http://bugzilla.gnome.org/show_bug.cgi?id=594405
* Bug 566530 - Handle (illegal) unencoded spaces in URIsDan Winship2009-03-231-1/+5
| | | | | | | | | | | | | | | * libsoup/soup-uri.c (uri_normalized_copy): optionally fix up parts with unencoded spaces in them. (soup_uri_new_with_base): tell uri_normalized_copy() to fix up spaces in the path and query components * tests/uri-parsing.c (abs_tests): test parsing and unparsing a URI with an unencoded space in it. * tests/redirect-test.c (tests, server_callback): add a test of redirecting to a URI with an unencoded space in it. svn path=/trunk/; revision=1252
* Misc fixes noticed by "sparse" or by running gcc with additionalDan Winship2008-04-051-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -W flags * libsoup/soup-auth-manager-ntlm.c (ntlm_authorize_post): fix a potentially uninitialized variable. (Grumble. gcc needs -Wdo-optimization-so-you-can-generate-code-flow-related-warnings- but-then-emit-unoptimized-code-for-ease-of-debugging) * libsoup/soup-gnutls.c (soup_gnutls_channel_funcs): make this static * libsoup/soup-uri.c (uri_decoded_copy, uri_normalized_copy): add "static". (This doesn't change the generated code; the prototype was already declared static and so gcc was treating the function as static even though the main declaration *wasn't* declared static. I'm not sure if this is a bug in gcc or an oddity of the spec, but it's confusing, so...) * libsoup/soup-xmlrpc.c (soup_xmlrpc_build_method_response): s/FALSE/NULL/ * libsoup/soup-xmlrpc.h: add G_GNUC_PRINTF to soup_xmlrpc_build_format * tests/*.c: misc minor fixes, mostly involving missing "const"s and "static"s to get better warnings, and then remove some unused variables. * tests/continue-test.c (do_message): fix a crash when the test fails * tests/test-utils.h (debug_printf): add G_GNUC_PRINTF to prototype svn path=/trunk/; revision=1123
* fix to not sometimes read beyond the end of the string.Dan Winship2008-01-271-0/+2
| | | | | | | | | | | | | | | | | | | | * libsoup/soup-headers.c (soup_header_parse_quality_list): fix to not sometimes read beyond the end of the string. * libsoup/soup-message-body.c (soup_message_body_append): When appending a 0-length SOUP_MEMORY_TAKE buffer, we need to free the passed-in buffer rather than just ignoring it. * libsoup/soup-server.c (got_headers): fix leak when decoding path * libsoup/soup-session.c (finalize): free ntlm_manager * tests/libsoup.supp: update for libsoup 2.4, glib 2.14, etc * tests/header-parsing.c (do_qvalue_tests): * tests/uri-parsing.c (main): more cleanup svn path=/trunk/; revision=1055
* Merge libsoup-2.4 branch to trunkDan Winship2008-01-151-69/+96
| | | | | | * Merge libsoup-2.4 branch to trunk svn path=/trunk/; revision=1041
* free proxy-related stuffDan Winship2007-10-281-0/+1
| | | | | | | | | | | * libsoup/soup-session.c (finalize): free proxy-related stuff * libsoup/soup-session-async.c (idle_run_queue): clean up the weak pointer * tests/*.c: fix leaks svn path=/trunk/; revision=946
* Make these less verbose by default (to make it easier to see what failedDan Winship2007-10-281-13/+45
| | | | | | | | | | | | | * tests/auth-test.c: * tests/date.c: * tests/header-parsing.c: * tests/ntlm-test.c: * tests/proxy-test.c: * tests/uri-parsing.c: * tests/xmlrpc-test.c: Make these less verbose by default (to make it easier to see what failed when a "make check" fails). svn path=/trunk/; revision=945
* fix lots of warnings. Partially from patches from Andrew W. Nosenko, andDan Winship2006-11-031-3/+3
| | | | | * libsoup/*.c: fix lots of warnings. Partially from patches from Andrew W. Nosenko, and also some fixes from libsoup-pre214-branch.
* Allow relative URIs, since some servers are lame. Based on a patch fromDan Winship2005-07-151-1/+10
| | | | | | | | | * libsoup/soup-session.c (redirect_handler): Allow relative URIs, since some servers are lame. Based on a patch from Jean-Yves Lefort. [#270688] * tests/uri-parsing.c: add some more tests to make sure that things that should be %-escaped do get %-escaped
* if the protocol is http or https, require a hostname. For #61049Dan Winship2004-07-071-5/+24
| | | | | | | * libsoup/soup-uri.c (soup_uri_new_with_base): if the protocol is http or https, require a hostname. For #61049 * tests/uri-parsing.c (rel_tests, do_uri): Update for that
* New header with typedefs, to avoid #include loops among other headers.Dan Winship2003-08-271-1/+1
| | | | | | | | | * libsoup/soup-types.h: New header with typedefs, to avoid #include loops among other headers. * libsoup/Makefile.am (libsoupinclude_HEADERS): add it * libsoup/*.[ch], tests/*.c: Update for soup-types.h
* Pull over some new test programs from the soup-refactoring branch,Dan Winship2003-08-121-0/+147
along with the SoupUri changes they depend on. * tests/simple-httpd.c: A really simple HTTP server, to test the server code. * tests/simple-proxy.c: An even simpler HTTP proxy * tests/get.c: Add "-r" flag to recursively get files (thereby testing multiple-connections-at-once code). Also good for setting up a tree to use with simple-httpd. * tests/timeserver.c (main): Fix a bug. (s/ipv6/ipv4/ in the normal case) * tests/uri-parsing.c: Regression test for the new soup-uri.c * libsoup/soup-uri.c: Rewrite/update to conform to RFC 2396, and pull in some optimizations from camel-url. Also, make SoupProtocol a GQuark so we can still compare them with ==, but we can also recognize any protocol. (soup_uri_new_with_base): New, to merge base and relative URIs (soup_uri_to_string): Update this. Change the "show_password" flag (which we always passed FALSE for) to "just_path", for places that want the path+query without the protocol, host, etc. * libsoup/soup-queue.c (soup_get_request_header): Just use soup_uri_to_string to generate the request URI. * libsoup/soup-auth.c (compute_response, digest_auth_func): Use "soup_uri_to_path (uri, TRUE)" rather than trying to reassemble the URI by hand badly. * libsoup/soup-server-auth.c (parse_digest): Likewise * libsoup/soup-socks.c (soup_connect_socks_proxy): Change a switch() to an series of if()s since SOUP_PROTOCOL_* aren't constants any more. * libsoup/soup-context.c (soup_context_uri_hash, soup_context_uri_equal): s/querystring/query/