summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2012-02-25SoupURI: fix fallback handling of soup_uri_set_path(uri, NULL)Dan Winship1-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
2012-02-24SoupAuthManagerNTLM: fix don't-fallback-to-Basic codeDan Winship1-42/+90
Sessions using NTLM should never fall back to using Basic auth to access a resource which advertises NTLM auth. But ntlm-test wasn't actually testing this, and it broke at some point. Fix that, and add tests to ntlm-test.
2012-02-13SoupSessionAsync: don't queue idles from dispose()Dan Winship1-0/+33
SoupSession does a soup_session_abort() from dispose(), which had the effect in SoupSessionAsync of queueing an idle (to check if new messages could be sent now that old connections had been closed). This causes problems if the session was disposed from a thread other than the one that its GMainContext is running in, which is weird, and also incompatible with some garbage-collected runtimes. So fix that. https://bugzilla.gnome.org/show_bug.cgi?id=667364
2012-02-13soup-message-server-io: fix processing of IPv6 HTTP/1.0 messagesDan Winship1-0/+51
When receiving an HTTP/1.0 message with no Host header on an IPv6 interface, SoupServer would internally generate an invalid URL and then return 400 Bad Request. Fix, and add a test for it. https://bugzilla.gnome.org/show_bug.cgi?id=666399
2012-02-12valgrind run...Dan Winship2-6/+77
2012-02-10soup-uri: revert some of the previously-added return-if-failsDan Winship1-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
2012-02-08tests: sniffing: Avoid loop with uninitialised lengthRobert Swain1-1/+1
[This would only happen if a request was made to an unhandled path, which this test doesn't do, but it seems reasonable to return an empty response rather than crashing. -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Dan Winship <danw@gnome.org> Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479 Bug-NB: NB#297634
2012-02-08tests: simple-httpd: Don't leak index_path stringRobert Swain1-0/+1
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Dan Winship <danw@gnome.org> Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479 Bug-NB: NB#297634
2012-02-03uri-parsing test: add a case that was exercised by a protocol fuzzerSimon McVittie1-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>
2012-02-03uri-parsing test: verify that URIs are split correctlySimon McVittie1-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>
2012-02-03Header parsing test: verify that a full URI can appear after the "GET"Simon McVittie1-0/+24
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Dan Winship <danw@gnome.org>
2012-01-30requester-test: add some more testsDan Winship1-5/+26
Make sure that content-sniffing and redirections work
2012-01-27chunk-test: add a check that wrote-body-data gives the right dataDan Winship1-0/+56
(This was already working, but not tested, on master, but it was broken on a work branch.)
2012-01-18SoupSession: Do not actually send a request if it was cancelled before.Raphael Kubo da Costa1-0/+26
soup_session_cancel_message() may have been called in a REQUEST_STARTED callback, so it is safer to make sure that soup_connection_send_request() is called only if that is not the case. https://bugzilla.gnome.org/show_bug.cgi?id=668098
2012-01-16Belatedly add regression test for CVE-2011-2524Dan Winship1-0/+28
https://bugzilla.gnome.org/show_bug.cgi?id=667635
2011-12-22Force some SoupMessages to use a fresh SoupConnectionDan Winship1-4/+71
Add a new SOUP_MESSAGE_NEW_CONNECTION flag, and insist on getting a brand new SoupConnection for any message that has that flag set, or that uses a non-idempotent method. Add a test to misc-test for this. https://bugzilla.gnome.org/show_bug.cgi?id=578990
2011-12-21soup-headers: misc improvementsDan Winship1-5/+118
Return an error if the headers start with '\0', ignore header lines with zero-length header names, and convert excess CRs to spaces. All of these could possibly occur in received headers, and were previously hitting g_return_if_fails(). Add a bunch of test cases to header-tests to test these cases (and some others that we already handled correctly but weren't testing). Fix the documentation of @str on soup_headers_parse* to reflect reality. Based on a patch from Simon McVittie. https://bugzilla.gnome.org/show_bug.cgi?id=666316
2011-12-01soup-session: fix some http-aliases/https-aliases problemsDan Winship1-3/+103
and add a test to misc-test
2011-12-01misc-test: fix a bugDan Winship1-5/+10
misc-test would crash if it ran long enough (due to either stopping in gdb or just adding enough new tests to the end) because of a bug in the max_conns_test cleanup code.
2011-12-01Require glib 2.31 and update to new thread APIsDan Winship4-31/+22
2011-11-30SoupMessage: fix setting of SOUP_MESSAGE_CERTIFICATE_TRUSTED flagDan Winship1-0/+15
It was accidentally getting cleared at the wrong time (although the tls-certificate and tls-errors properties were still correct). Also add a test for this case. https://bugzilla.gnome.org/show_bug.cgi?id=665182
2011-11-21Fix distcheckDan Winship1-2/+4
2011-11-17coding-test.c: refactored and added deflate support.Sergio Villar Senin1-205/+166
Refactored the original code. A couple of utility functions perform now all the checks. Content compressed with deflate algorithm (with or without zlib headers) is also supported and checked.
2011-11-17Adding zlib and raw encoded versions of mbox file for the coding-testSergio Villar Senin2-0/+0
2011-11-13SoupAuthManagerNTLM: allow non-ASCII usernames/passwordsDan Winship2-3/+9
Switch to using the Unicode-encoded form of NTLM, so that non-ASCII usernames/passwords will work. Also, add a "-n" option to tests/get to make it use NTLM, and make SoupAuthManagerNTLM allow passwords-in-URLs. Based on a patch from Joachim Breitner, sponsored by ITOMIG GmbH and the City of Böblingen. https://bugzilla.gnome.org/show_bug.cgi?id=576838
2011-11-13auth-test: add a test for server-closes-connection-during-authDan Winship1-0/+95
2011-11-13auth-test: reorganize this a bit to be more like other test programsDan Winship1-127/+136
2011-11-12context-test: fix cleanup code to avoid a crashDan Winship1-4/+5
2011-11-12soup-uri: %-encode non-ASCII characters when parsing URIsDan Winship1-1/+4
https://bugzilla.gnome.org/show_bug.cgi?id=662806
2011-11-08Add SoupSession:use-thread-contextDan Winship1-24/+156
Add a SoupSession flag telling it to use g_main_context_get_thread_default() on a per-message basis, rather than using a single GMainContext for everything. In the simple case, this is just more glib-like API. In the more complicated case, it allows synchronously sending one or more messages on a SoupSessionAsync without running the main GMainLoop. https://bugs.webkit.org/show_bug.cgi?id=68238
2011-11-05SoupSession: add some API for handling redirectionsDan Winship5-28/+9
2011-10-26remove unnecessary libgthread referencesDan Winship6-6/+0
2011-10-20oops, I apparently didn't run "make check" after the tls changes...Dan Winship1-0/+6
2011-10-20tests: make "./tests/foo" work from the toplevel dirDan Winship1-1/+1
2011-10-20Fix SoupMessage https status information to be set more reliablyDan Winship1-0/+7
In particular, make sure it gets set when a connection fails, so that soup_message_get_https_status() on the message will tell you *why* it failed. Also, update tests/get to display the tls-certificate-errors
2011-09-29libsoup.supp: belatedly commit some fixesDan Winship1-1/+8
2011-09-29redirect-test: add a test for accidental connection sharingDan Winship1-11/+129
https://bugzilla.gnome.org/show_bug.cgi?id=651146
2011-09-19tests/ssl-test: belatedly commit thisDan Winship1-0/+166
2011-09-19tests/ssl-test: add a test of https-related functionalityDan Winship1-0/+3
2011-09-19tests: update the test ssl keyDan Winship3-34/+40
Update the test ssl key to specify "CN=127.0.0.1", so we don't get G_TLS_CERTIFICATE_BAD_IDENTITY from it
2011-09-17tests: fix a few leaks, update valgrind suppressions fileDan Winship4-2/+137
2011-08-16Add SOUP_MESSAGE_CAN_REBUILD, for regeneratable streamed request bodiesDan Winship1-44/+68
Long ago, soup_message_body_set_accumulate() was made into a no-op on request bodies, because otherwise there would be no body available to send if the request was restarted. Add a SOUP_MESSAGE_CAN_REBUILD flag, that indicates that the caller takes responsibility for handling this, and properly discard chunks if that is set. Also update chunk-test to test this, and (finally!) remove the FIXME there, since we are now testing the !accumulate codepath again properly. https://bugzilla.gnome.org/show_bug.cgi?id=656650
2011-08-15Fix distcheckDan Winship1-1/+4
2011-08-08SoupContentSniffer: don't use gio anymorearno4-21/+17
This brings the content sniffing algorithm closer to the HTML5 specification. https://bugzilla.gnome.org/show_bug.cgi?id=648846
2011-08-08Call soup_message_clean_response() when restarting a messageDan Winship2-1/+41
When a message got restarted, we were leaving the previous response state in the message, which is bad for various reasons. In particular, this caused a problem with non-keepalive redirections of https URLs through proxies (!), because after the second CONNECT succeeded, it would see that the message already had a status_code set, and so it thought the message had been cancelled or something while it was processing the CONNECT. proxy-test now has a regression test for this case. Based on patches and analysis from DongJae Kim and Thierry Reding. https://bugzilla.gnome.org/show_bug.cgi?id=631368
2011-07-31soup-request-http: fix usage with non-default-contextDan Winship2-0/+216
SoupHTTPInputStream was doing I/O in a thread if the session didn't use the global default context. But really, it should have been checking the thread-default context instead. And anyway, the threaded version doesn't actually work, it turns out. So, fix the check, make it into a g_return_if_fail(), and remove the threaded codepath. Also, fix a handful of places that were adding sources to the global default context rather than the thread-default/SoupSession context. Add tests/requester-test to do some basic SoupRequester/SoupRequestHTTP/SoupHTTPInputStream testing. https://bugzilla.gnome.org/show_bug.cgi?id=653707
2011-06-03Fix few memory leaksMilan Crha1-0/+2
https://bugzilla.gnome.org/show_bug.cgi?id=651643
2011-05-22SoupContentDecoder: deal with broken apache Content-EncodingDan Winship1-32/+138
When sending a .gz file, Apache will (by default) incorrectly claim "Content-Encoding: gzip", causing us to do the wrong thing with it. Work around this bug in the same way Firefox does. https://bugzilla.gnome.org/show_bug.cgi?id=613361
2011-04-07Fix memory leaks, update libsoup.suppDan Winship3-20/+69
2011-04-07header-parsing: update tests for RFC 5987 and multipart quoting changesDan Winship1-17/+100