* libsoup/soup-session.c (finalize): free priv->user_agent.
#518798, Wouter Cloetens.
+ (redirect_handler): PROPFIND is defined to be "safe and
+ idempotent", so allow automatic redirects of it. (Pointed out by
+ Christian Kellner. FIXME: need a way for apps to declare
+ additional safe methods). Also, treat 302 like 307, not like 303,
+ because that behavior is universal in the real world, despite the
+ spec's protests.
+
+ * tests/redirect-test.c (tests): update POST 302 behavior check
+
+ * tests/Makefile.am (TESTS): oops, add redirect-test so it gets
+ run by "make check"/"make distcheck"
* tests/ssl-test.c: Re-revert the change from 2008-02-09; the
problem with ssl-test.c was not that soup_gnutls_init() wasn't
g_return_if_fail (new_loc != NULL);
if (msg->status_code == SOUP_STATUS_MOVED_PERMANENTLY ||
- msg->status_code == SOUP_STATUS_FOUND ||
msg->status_code == SOUP_STATUS_TEMPORARY_REDIRECT) {
/* Don't redirect non-safe methods */
if (msg->method != SOUP_METHOD_GET &&
msg->method != SOUP_METHOD_HEAD &&
- msg->method != SOUP_METHOD_OPTIONS)
+ msg->method != SOUP_METHOD_OPTIONS &&
+ msg->method != SOUP_METHOD_PROPFIND)
return;
- } else if (msg->status_code == SOUP_STATUS_SEE_OTHER) {
+ } else if (msg->status_code == SOUP_STATUS_SEE_OTHER ||
+ msg->status_code == SOUP_STATUS_FOUND) {
/* Redirect using a GET */
g_object_set (msg,
SOUP_MESSAGE_METHOD, SOUP_METHOD_GET,
continue-test \
date \
header-parsing \
- uri-parsing \
ntlm-test \
+ redirect-test \
+ uri-parsing \
$(APACHE_TESTS) \
$(CURL_TESTS) \
$(SSL_TESTS) \
{ "GET", "/302", 302 },
{ "GET", "/", 200 } } },
- /* POST should only automatically redirect on 303 */
+ /* POST should only automatically redirect on 302 and 303 */
{ { { "POST", "/301", 301 },
{ NULL } } },
{ { { "POST", "/302", 302 },
+ { "GET", "/", 200 },
{ NULL } } },
{ { { "POST", "/303", 303 },
{ "GET", "/", 200 },