Summary Files Commits Branches @commit @diff @stats
path: root / badwolf.c
diff options
context:
space:
mode:
Commit3f0e2f50f21a1968fc3217c3be436f7fb586dca0 (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2021-09-19 07:44:54 +0200
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2021-09-19 07:47:08 +0200
Files948a192e323091ed4392a783c109e7e7b04733c8 /badwolf.c
goodwolf-3f0e2f50f21a1968fc3217c3be436f7fb586dca0.tar
goodwolf-3f0e2f50f21a1968fc3217c3be436f7fb586dca0.tar.gz
goodwolf-3f0e2f50f21a1968fc3217c3be436f7fb586dca0.zip
Parentffc2fc8762f7f496162e4c2fa0d535a9fe1a27fe (diff)
Switch from libsoup-2.4 to glib's GUri
- SoupURI is gone in libsoup-3.0 - GUri got added in glib-2.66 - WebKitGTK 2.32.0 depends on >=glib-2.67
1 files changed, 8 insertions, 3 deletions
-rw-r--r--badwolf.c11
diff --git a/badwolf.c b/badwolf.c
index 6ef4cf3..a0a7d09 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -439,7 +439,8 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view,
struct Client *browser = (struct Client *)user_data;
gchar *error_details = detail_tls_certificate_flags(errors);
gint dialog_response;
- SoupURI *failing_uri = soup_uri_new(failing_text);
+
+ GUri *failing_uri = g_uri_parse(failing_text, G_URI_FLAGS_NONE, NULL);
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(browser->window->main_window),
GTK_DIALOG_MODAL & GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -449,6 +450,10 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view,
failing_text);
gtk_dialog_add_buttons(
GTK_DIALOG(dialog), _("Temporarily Add Exception"), 1, _("Continue"), 0, NULL);
+ if(!failing_uri)
+ {
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), 1, FALSE);
+ }
gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0);
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s\n", error_details);
@@ -457,11 +462,11 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view,
if(dialog_response == 1)
{
webkit_web_context_allow_tls_certificate_for_host(
- webkit_web_view_get_context(browser->webView), certificate, failing_uri->host);
+ webkit_web_view_get_context(browser->webView), certificate, g_uri_get_host(failing_uri));
webkit_web_view_reload(browser->webView);
}
- soup_uri_free(failing_uri);
+ g_free(failing_uri);
g_free(error_details);
gtk_widget_destroy(dialog);