utils/source-discoverer: Set the User-Agent

This avoids some web servers or WAFs doing weird stuff with our requests
which would lead to situations where our web calendar source discovery
would face server errors, redirects, incorrect contents, etc.

Fixes #651

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/290
This commit is contained in:
Jean-François Fortin Tam
2024-08-07 12:32:00 -04:00
parent 5addd751fa
commit 008b914f9e
4 changed files with 37 additions and 8 deletions
+1 -1
View File
@@ -281,7 +281,7 @@ discover_file_in_thread (DiscovererData *data,
uri_str = g_uri_to_string_partial (guri, G_URI_HIDE_PASSWORD);
GCAL_TRACE_MSG ("Creating request for %s", uri_str);
session = soup_session_new_with_options ("timeout", 10, NULL);
session = gcal_create_soup_session ();
message = soup_message_new_from_uri ("GET", guri);
g_signal_connect (message, "authenticate", G_CALLBACK (on_soup_message_authenticate_cb), data);