summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/view-source.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/view-source.c b/src/view-source.c
index 71d3438..3c46127 100644
--- a/src/view-source.c
+++ b/src/view-source.c
@@ -50,7 +50,8 @@ static const gchar *document =
"</html>\n";
static void
-respond(WebKitURISchemeRequest *request, guchar *data, gsize length)
+respond(WebKitURISchemeRequest *request, const gchar *uri, guchar *data,
+ gsize length)
{
gchar *escaped_data;
GInputStream *stream;
@@ -61,7 +62,7 @@ respond(WebKitURISchemeRequest *request, guchar *data, gsize length)
g_strdup_printf(document,
gtk_widget_get_default_direction() ==
GTK_TEXT_DIR_RTL ? "rtl" : "ltr",
- "TODO", escaped_data), -1, g_free);
+ uri, escaped_data), -1, g_free);
webkit_uri_scheme_request_finish(request, stream, -1, "text/html");
g_object_unref(stream);
@@ -75,7 +76,7 @@ data_cb(MqWebView *web_view, GParamSpec G_GNUC_UNUSED *param_spec,
gsize length;
data = mq_web_view_get_data(web_view, &length);
- respond(data_signal_data->request, data, length);
+ respond(data_signal_data->request, data_signal_data->uri, data, length);
g_signal_handler_disconnect(web_view, data_signal_data->handler_id);
g_free(data_signal_data->uri);
g_free(data_signal_data);
@@ -111,7 +112,7 @@ mq_view_source_request(WebKitURISchemeRequest *request,
/* Get origin tab's data. */
data = mq_web_view_get_data(origin_web_view, &length);
if (data) {
- respond(request, data, length);
+ respond(request, uri, data, length);
} else {
data_signal_data = g_new(DataSignalData, 1);
data_signal_data->request = request;