+2005-07-15 Dan Winship <danw@novell.com>
+
+ * 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
+
2005-07-06 Tor Lillqvist <tml@novell.com>
* libsoup/soup-date.c (soup_gmtime): Mention in the doc comment
new_loc = soup_message_get_header (msg->response_headers, "Location");
if (!new_loc)
return;
- new_uri = soup_uri_new (new_loc);
+
+ /* Location is supposed to be an absolute URI, but some sites
+ * are lame, so we use soup_uri_new_with_base().
+ */
+ new_uri = soup_uri_new_with_base (soup_message_get_uri (msg), new_loc);
if (!new_uri) {
soup_message_set_status_full (msg,
SOUP_STATUS_MALFORMED,
{ "http://us%65r@host", "http://user@host" },
{ "http://us%40r@host", "http://us%40r@host" },
{ "http://us%3ar@host", "http://us%3ar@host" },
- { "http://us%2fr@host", "http://us%2fr@host" }
+ { "http://us%2fr@host", "http://us%2fr@host" },
+
+ { "http://control-chars/%01%02%03%04%05%06%07%08%09%0a%0b%0c%0d%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f%7f",
+ "http://control-chars/%01%02%03%04%05%06%07%08%09%0a%0b%0c%0d%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f%7f"},
+ { "http://space/%20",
+ "http://space/%20" },
+ { "http://delims/%3c%3e%23%25%22",
+ "http://delims/%3c%3e%23%25%22" },
+ { "http://unwise-chars/%7b%7d%7c%5c%5e%5b%5d%60",
+ "http://unwise-chars/%7b%7d%7c%5c%5e%5b%5d%60" }
};
int num_abs_tests = G_N_ELEMENTS(abs_tests);