[epiphany] sync-service: set user agent on SoupSession



commit 05f1c371c14ae361caec2c6c68d8a29f4b941833
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Oct 8 14:51:08 2016 -0500

    sync-service: set user agent on SoupSession
    
    Mozilla's terms of service imply that this is a requirement, in a
    roundabout way that avoids mentioning "user agent," but it's clear this
    is what they want.

 src/ephy-sync-service.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-sync-service.c b/src/ephy-sync-service.c
index 84b23f5..908f1dc 100644
--- a/src/ephy-sync-service.c
+++ b/src/ephy-sync-service.c
@@ -24,6 +24,7 @@
 #include "ephy-bookmark.h"
 #include "ephy-bookmarks-manager.h"
 #include "ephy-debug.h"
+#include "ephy-embed-prefs.h"
 #include "ephy-password-notification.h"
 #include "ephy-settings.h"
 #include "ephy-shell.h"
@@ -608,10 +609,16 @@ static void
 ephy_sync_service_init (EphySyncService *self)
 {
   char *email;
+  const char *user_agent;
+  WebKitSettings *settings;
 
   self->session = soup_session_new ();
   self->storage_queue = g_queue_new ();
 
+  settings = ephy_embed_prefs_get_settings ();
+  user_agent = webkit_settings_get_user_agent (settings);
+  g_object_set (self->session, "user-agent", user_agent, NULL);
+
   email = g_settings_get_string (EPHY_SETTINGS_MAIN, EPHY_PREFS_SYNC_USER);
 
   if (g_strcmp0 (email, "") != 0) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]