summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-02-28 19:08:31 +0100
committerMilan Crha <mcrha@redhat.com>2013-02-28 19:08:31 +0100
commitf1a6b21f727c076a880ac73ee3b5ef5e1b527cdf (patch)
tree3e6bf4656ab5ed778cab7407face2835184575e2
parent1f138d6516232b0860540c85427af84d8575130d (diff)
downloadevolution-data-server-f1a6b21f727c076a880ac73ee3b5ef5e1b527cdf.tar.gz
Bug #694734 - Relative URI in Location on PUT confuses WebDAV
-rw-r--r--addressbook/backends/webdav/e-book-backend-webdav.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c b/addressbook/backends/webdav/e-book-backend-webdav.c
index 0b3410c68..f124b79ae 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav.c
@@ -261,8 +261,15 @@ upload_contact (EBookBackendWebdav *webdav,
SoupURI *suri = soup_uri_new (uri);
gchar *full_uri;
- soup_uri_set_path (suri, redir_uri);
- full_uri = soup_uri_to_string (suri, TRUE);
+ if (*redir_uri != '/' && *redir_uri != '\\') {
+ gchar *slashed_path = g_strconcat ("/", redir_uri, NULL);
+
+ soup_uri_set_path (suri, slashed_path);
+ g_free (slashed_path);
+ } else {
+ soup_uri_set_path (suri, redir_uri);
+ }
+ full_uri = soup_uri_to_string (suri, FALSE);
e_contact_set (contact, E_CONTACT_UID, full_uri);
@@ -1030,7 +1037,7 @@ download_contacts (EBookBackendWebdav *webdav,
SoupURI *soup_uri = soup_uri_new (priv->uri);
soup_uri->path = g_strdup (uri);
- complete_uri = soup_uri_to_string (soup_uri, 0);
+ complete_uri = soup_uri_to_string (soup_uri, FALSE);
soup_uri_free (soup_uri);
} else {
complete_uri = g_strdup (uri);