[evolution-data-server] Fix for bug #429317



commit 7ec75be782456889a805b5aedc7696804d2b6597
Author: Petr Tomasek <tomasek etf cuni cz>
Date:   Fri Aug 28 11:00:11 2009 +0530

    Fix for bug #429317

 calendar/backends/http/e-cal-backend-http.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c
index 7e7320d..826eaa8 100644
--- a/calendar/backends/http/e-cal-backend-http.c
+++ b/calendar/backends/http/e-cal-backend-http.c
@@ -284,6 +284,7 @@ retrieval_done (SoupSession *session, SoupMessage *msg, ECalBackendHttp *cbhttp)
 	icalcomponent *icalcomp, *subcomp;
 	icalcomponent_kind kind;
 	const gchar *newuri;
+       SoupURI *uri_parsed;
 	GHashTable *old_cache;
 	GSList *comps_in_cache;
 
@@ -303,9 +304,22 @@ retrieval_done (SoupSession *session, SoupMessage *msg, ECalBackendHttp *cbhttp)
 		newuri = soup_message_headers_get (msg->response_headers,
 						   "Location");
 
-		d(g_message ("Redirected to %s\n", newuri));
+		d(g_message ("Redirected from %s to %s\n", priv->uri, newuri));
 
 		if (newuri) {
+			if (newuri[0]=='/') {
+				g_warning ("Hey! Relative URI returned! Working around...\n");
+
+				uri_parsed = soup_uri_new (priv->uri);
+				soup_uri_set_path (uri_parsed, newuri);
+				soup_uri_set_query (uri_parsed, NULL);
+				// g_free(newuri);
+
+				newuri = soup_uri_to_string (uri_parsed, FALSE);
+				g_message ("Translated URI: %s\n", newuri);
+				soup_uri_free (uri_parsed);
+			}
+
 			g_free (priv->uri);
 
 			priv->uri = webcal_to_http_method (newuri, FALSE);



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