[epiphany] form-auth: Change type of target origin from SoupURI to char *
- From: Gabriel Ivașcu <gabrielivascu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] form-auth: Change type of target origin from SoupURI to char *
- Date: Wed, 30 Aug 2017 14:25:22 +0000 (UTC)
commit 5bf05e187d32f29a513b9ffe3fc69b26b1d33565
Author: Gabriel Ivascu <gabrielivascu gnome org>
Date: Wed Aug 30 16:27:08 2017 +0300
form-auth: Change type of target origin from SoupURI to char *
soup_uri_new() appends a / to the target origin, thus causing the value
passed to ephy_embed_form_auth_new() to be different from the one
returned by ephy_embed_form_auth_get_target_origin().
https://bugzilla.gnome.org/show_bug.cgi?id=786994
embed/web-extension/ephy-embed-form-auth.c | 11 +++++------
embed/web-extension/ephy-embed-form-auth.h | 2 +-
embed/web-extension/ephy-web-extension.c | 6 ++----
3 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/embed/web-extension/ephy-embed-form-auth.c b/embed/web-extension/ephy-embed-form-auth.c
index 6a74b87..8e5b8b4 100644
--- a/embed/web-extension/ephy-embed-form-auth.c
+++ b/embed/web-extension/ephy-embed-form-auth.c
@@ -26,7 +26,7 @@ struct _EphyEmbedFormAuth {
guint64 page_id;
SoupURI *uri;
- SoupURI *target_origin;
+ char *target_origin;
WebKitDOMNode *username_node;
WebKitDOMNode *password_node;
char *username;
@@ -42,8 +42,7 @@ ephy_embed_form_auth_finalize (GObject *object)
if (form_auth->uri)
soup_uri_free (form_auth->uri);
- if (form_auth->target_origin)
- soup_uri_free (form_auth->target_origin);
+ g_free (form_auth->target_origin);
g_clear_object (&form_auth->username_node);
g_clear_object (&form_auth->password_node);
@@ -78,7 +77,7 @@ ephy_embed_form_auth_new (WebKitWebPage *web_page,
form_auth->page_id = webkit_web_page_get_id (web_page);
form_auth->uri = soup_uri_new (webkit_web_page_get_uri (web_page));
- form_auth->target_origin = soup_uri_new (target_origin);
+ form_auth->target_origin = g_strdup (target_origin);
form_auth->username_node = username_node;
form_auth->password_node = password_node;
form_auth->username = g_strdup (username);
@@ -86,10 +85,10 @@ ephy_embed_form_auth_new (WebKitWebPage *web_page,
return form_auth;
}
-char *
+const char *
ephy_embed_form_auth_get_target_origin (EphyEmbedFormAuth *form_auth)
{
- return soup_uri_to_string (form_auth->target_origin, FALSE);
+ return form_auth->target_origin;
}
WebKitDOMNode *
diff --git a/embed/web-extension/ephy-embed-form-auth.h b/embed/web-extension/ephy-embed-form-auth.h
index 2725eaf..c3b7e62 100644
--- a/embed/web-extension/ephy-embed-form-auth.h
+++ b/embed/web-extension/ephy-embed-form-auth.h
@@ -37,7 +37,7 @@ EphyEmbedFormAuth *ephy_embed_form_auth_new (WebKitWebPage
const char *username);
WebKitDOMNode *ephy_embed_form_auth_get_username_node (EphyEmbedFormAuth *form_auth);
WebKitDOMNode *ephy_embed_form_auth_get_password_node (EphyEmbedFormAuth *form_auth);
-char *ephy_embed_form_auth_get_target_origin (EphyEmbedFormAuth *form_auth);
+const char *ephy_embed_form_auth_get_target_origin (EphyEmbedFormAuth *form_auth);
SoupURI *ephy_embed_form_auth_get_uri (EphyEmbedFormAuth *form_auth);
guint64 ephy_embed_form_auth_get_page_id (EphyEmbedFormAuth *form_auth);
const char *ephy_embed_form_auth_get_username (EphyEmbedFormAuth *form_auth);
diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c
index 93be7ad..9e3264b 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -267,11 +267,11 @@ store_password (EphyEmbedFormAuth *form_auth)
SoupURI *uri;
char *uri_str;
char *origin;
- char *target_origin;
char *username_field_name = NULL;
char *username_field_value = NULL;
char *password_field_name = NULL;
char *password_field_value = NULL;
+ const char *target_origin;
gboolean password_updated;
WebKitDOMNode *username_node;
EphyWebExtension *extension = ephy_web_extension_get ();
@@ -305,7 +305,6 @@ store_password (EphyEmbedFormAuth *form_auth)
g_free (uri_str);
g_free (origin);
- g_free (target_origin);
g_free (username_field_name);
g_free (username_field_value);
g_free (password_field_name);
@@ -570,10 +569,10 @@ pre_fill_form (EphyEmbedFormAuth *form_auth)
SoupURI *uri;
char *uri_str;
char *origin;
- char *target_origin;
char *username = NULL;
char *username_field_name = NULL;
char *password_field_name = NULL;
+ const char *target_origin;
WebKitDOMNode *username_node;
WebKitDOMNode *password_node;
EphyWebExtension *extension;
@@ -615,7 +614,6 @@ pre_fill_form (EphyEmbedFormAuth *form_auth)
g_free (uri_str);
g_free (origin);
- g_free (target_origin);
g_free (username);
g_free (username_field_name);
g_free (password_field_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]