aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed-persist.c
diff options
context:
space:
mode:
Diffstat (limited to 'embed/ephy-embed-persist.c')
-rw-r--r--embed/ephy-embed-persist.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/embed/ephy-embed-persist.c b/embed/ephy-embed-persist.c
index 44910fe9c..8ee3df39e 100644
--- a/embed/ephy-embed-persist.c
+++ b/embed/ephy-embed-persist.c
@@ -763,7 +763,36 @@ ephy_embed_persist_save (EphyEmbedPersist *persist)
*/
g_object_ref (persist);
- request = webkit_network_request_new (priv->source);
+ if (priv->embed)
+ {
+ EphyWebView *web_view;
+ SoupMessage *msg;
+ gchar *referer;
+
+ /* Get the webview associated to the embed */
+ web_view = ephy_embed_get_web_view (priv->embed);
+
+ /* Create the request with a SoupMessage to allow
+ setting the 'Referer' as got from the embed */
+ msg = soup_message_new (SOUP_METHOD_GET, priv->source);
+ request = WEBKIT_NETWORK_REQUEST (
+ g_object_new (WEBKIT_TYPE_NETWORK_REQUEST,
+ "message", msg,
+ NULL));
+
+ /* Add the referer to the request headers */
+ referer = ephy_web_view_get_location (web_view, FALSE);
+ soup_message_headers_append (msg->request_headers,
+ "Referer", referer);
+ g_free (referer);
+ g_object_unref (msg);
+ }
+ else
+ {
+ /* Create a normal network request otherwise */
+ request = webkit_network_request_new (priv->source);
+ }
+
priv->download = webkit_download_new (request);
g_object_unref (request);