[libsoup] docs: Remove incorrect redirect docs These changes never happened.
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] docs: Remove incorrect redirect docs These changes never happened.
- Date: Mon, 22 Feb 2021 20:00:00 +0000 (UTC)
commit 33b07391bb0c72c9754d9ed7d7af24364639f30f
Author: Patrick Griffis <pgriffis igalia com>
Date: Mon Feb 22 13:59:50 2021 -0600
docs: Remove incorrect redirect docs
These changes never happened.
docs/reference/client-advanced.xml | 32 -----------------------------
docs/reference/migrating-from-libsoup-2.xml | 7 -------
2 files changed, 39 deletions(-)
---
diff --git a/docs/reference/client-advanced.xml b/docs/reference/client-advanced.xml
index 270a5daa..c5ff3d4c 100644
--- a/docs/reference/client-advanced.xml
+++ b/docs/reference/client-advanced.xml
@@ -131,38 +131,6 @@ linkend="g-proxy-resolver-get-default"><function>g_proxy_resolver_get_default()<
g_object_unref (msg);
g_object_unref (session);
}]]>
-</programlisting></informalexample>
- </sect2>
- <sect2>
- <title>Controlling Redirections</title>
- <para>By default libsoup automatically handles redirections in a sane way without you needing to worry
about it.
- However you may want explicitly block all redirections or perhaps allow some unsafe redirections.
<literal>SoupMessage::redirect</literal>
- provides a way to do both of these:</para>
-<informalexample><programlisting><![CDATA[
-static SoupMessageRedirectionFlags
-redirect_callback (SoupMessage *msg, GUri *location, guint redirect_count, gpointer user_data)
-{
- // Here we could compare URIs, check redirect_count, etc. This just always prevents it.
- return SOUP_MESSAGE_REDIRECTION_BLOCK;
-}
-
-int main (int argc, char **argv)
-{
- SoupSession *session = soup_session_new ();
- // Google redirects to https://www.google.com/
- SoupMessage *msg = soup_message_new (SOUP_METHOD_GET, "https://google.com");
- g_signal_connect (msg, "redirect", G_CALLBACK (redirect_callback), NULL);
- GInputStream *in_stream = soup_session_send (session, msg, NULL, NULL);
-
- if (in_stream) {
- // The redirection was not allowed so we get the status code
- // soup_message_get_uri() will also show its unchanged
- g_assert (soup_message_get_status (msg) == SOUP_STATUS_MOVED_PERMANENTLY);
- g_object_unref (in_stream);
- }
-
- return 0;
-}]]>
</programlisting></informalexample>
</sect2>
<sect2>
diff --git a/docs/reference/migrating-from-libsoup-2.xml b/docs/reference/migrating-from-libsoup-2.xml
index 5242742f..04838338 100644
--- a/docs/reference/migrating-from-libsoup-2.xml
+++ b/docs/reference/migrating-from-libsoup-2.xml
@@ -186,12 +186,5 @@ linkend="soup-uri-decode-data-uri"><function>soup_uri_decode_data_uri()</functio
<link
linkend="soup_message_set_request_body_from_bytes"><function>soup_message_set_request_body_from_bytes()</function></link>
to use a GBytes
buffer.</para>
</sect2>
- <sect2>
- <title>Redirection handling changes</title>
- <para>Previously a common pattern was using <code>SOUP_MESSAGE_NO_REDIRECT</code> and
- manually handling re-queuing the message. This is now handled for you with the
- <link linkend="SoupMessage-redirect"><literal>SoupMessage::redirect</literal></link> signal
where you can block or allow redirects and libsoup
- handles the queueing.</para>
- </sect2>
</chapter>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]