Index: servers/google/libgdata-google/gdata-google-service.c
===================================================================
--- servers/google/libgdata-google/gdata-google-service.c	(Revision 8726)
+++ servers/google/libgdata-google/gdata-google-service.c	(Arbeitskopie)
@@ -248,8 +248,9 @@
 	GDataEntry *updated_entry = NULL;
 	SoupSession *soup_session;
 	SoupMessage *msg;
+	SoupURI *new_uri;
 	gchar *entry_xml;
-	int http_status;
+	const char *new_loc;
 
 	g_return_val_if_fail(service != NULL, NULL);
 	g_return_val_if_fail(GDATA_IS_GOOGLE_SERVICE(service), NULL);
@@ -278,10 +279,36 @@
 				entry_xml,
 				strlen(entry_xml));
 
-	http_status = soup_session_send_message(soup_session, msg);
-    	if (http_status != 201) {
+	/* Handle redirects ourself, since soup does not behave like google-api expects */
+	soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT);
+
+	soup_session_send_message (soup_session, msg);
+	if (msg->status_code == SOUP_STATUS_FOUND) {
+		new_loc = soup_message_headers_get (msg->response_headers, "Location");
+		g_return_if_fail (new_loc != NULL);
+
+		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,
+						      "Invalid Redirect URL");
+			g_set_error (error, SOUP_HTTP_ERROR,
+					 msg->status_code, soup_status_get_phrase (msg->status_code));
+			g_object_unref (msg);
+			return NULL;
+		}
+
+		soup_message_set_uri (msg, new_uri);
+		soup_uri_free (new_uri);
+
+		soup_session_send_message (soup_session, msg);
+	}
+    	
+	soup_message_set_flags (msg, (SoupMessageFlags)NULL);
+
+	if (msg->status_code != SOUP_STATUS_CREATED) {
 		g_set_error (error, SOUP_HTTP_ERROR,
-					 http_status, soup_status_get_phrase (http_status));
+					 msg->status_code, soup_status_get_phrase (msg->status_code));
 		g_object_unref (msg);
 		return NULL;
 	}
