[evolution-data-server/gnome-42] I#381 - EWebDAVSession: Correct extract of href from Location header
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-42] I#381 - EWebDAVSession: Correct extract of href from Location header
- Date: Tue, 22 Mar 2022 10:23:32 +0000 (UTC)
commit 76c7fe8bdff6c5e3a4d680baed3eb95881d6016b
Author: Milan Crha <mcrha redhat com>
Date: Tue Mar 22 11:21:16 2022 +0100
I#381 - EWebDAVSession: Correct extract of href from Location header
Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/381
src/libedataserver/e-webdav-session.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/libedataserver/e-webdav-session.c b/src/libedataserver/e-webdav-session.c
index 17b23b081..57e75f3d1 100644
--- a/src/libedataserver/e-webdav-session.c
+++ b/src/libedataserver/e-webdav-session.c
@@ -2018,16 +2018,14 @@ e_webdav_session_extract_href_and_etag (SoupMessage *message,
header = soup_message_headers_get_list (message->response_headers, "Location");
if (header) {
- gchar *file = strrchr (header, '/');
+ SoupURI *uri;
- if (file) {
- gchar *decoded;
+ uri = soup_uri_new_with_base (soup_message_get_uri (message), header);
+ if (uri && uri->host)
+ *out_href = soup_uri_to_string (uri, FALSE);
- decoded = soup_uri_decode (file + 1);
- *out_href = soup_uri_encode (decoded ? decoded : (file + 1), NULL);
-
- g_free (decoded);
- }
+ if (uri)
+ soup_uri_free (uri);
}
if (!*out_href)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]