evolution-data-server r9924 - in trunk/servers/exchange: . lib



Author: mcrha
Date: Mon Jan 12 18:05:42 2009
New Revision: 9924
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9924&view=rev

Log:
2009-01-12  Chow Loong Jin  <hyperair gmail com>

	** Fix for bug #518920

	* servers/exchange/lib/e2k-context.c (e2k_context_fba):
	Handle relative URIs in value of action attribute of form in 
	form-based authentication.



Modified:
   trunk/servers/exchange/ChangeLog
   trunk/servers/exchange/lib/e2k-context.c

Modified: trunk/servers/exchange/lib/e2k-context.c
==============================================================================
--- trunk/servers/exchange/lib/e2k-context.c	(original)
+++ trunk/servers/exchange/lib/e2k-context.c	Mon Jan 12 18:05:42 2009
@@ -613,8 +613,31 @@
 		g_free (suri->path);
 		suri->path = g_strdup (value);
 		action = soup_uri_to_string (suri, FALSE);
-		soup_uri_decode (action);
 		soup_uri_free (suri);
+	} else if (strncmp(value, "http", 4) != 0) {
+		SoupURI *suri;
+		char *path_end;
+		const char *location;
+
+		location = soup_message_headers_get (failed_msg->response_headers,
+		                                     "Location");
+		if (location != NULL) {/*Make sure we can get absolute path*/
+			suri = soup_uri_new (location);
+			if (suri != NULL) {/*Valid URI*/
+				if (!suri->path || strchr (suri->path, '/') == NULL)
+					goto failed;
+
+				path_end = strrchr (suri->path, '/') + 1;
+				*path_end = '\0';
+				suri->path = g_realloc (suri->path,
+		                                path_end - suri->path + strlen (value) + 1);
+				strcat (suri->path, value);
+				g_free (suri->query);
+				suri->query = NULL;
+				action = soup_uri_to_string (suri, FALSE);
+				soup_uri_free (suri);
+			}
+		}
 	} else
 		action = g_strdup (value);
 	xmlFree (value);



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