aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozDownload.cpp
diff options
context:
space:
mode:
authorJean-François Rameau <jframeau@cvs.gnome.org>2006-06-02 03:35:32 +0800
committerJean-François Rameau <jframeau@src.gnome.org>2006-06-02 03:35:32 +0800
commitae4e4736818f442abd435274cb3b75f8da02ad33 (patch)
treee552affa908143effd9f1fba8993eaa8ecf4e5f6 /embed/mozilla/MozDownload.cpp
parent5d471eec3390f8f188037ac6a3c87a59aa77ec8e (diff)
downloadgsoc2013-epiphany-ae4e4736818f442abd435274cb3b75f8da02ad33.tar
gsoc2013-epiphany-ae4e4736818f442abd435274cb3b75f8da02ad33.tar.gz
gsoc2013-epiphany-ae4e4736818f442abd435274cb3b75f8da02ad33.tar.bz2
gsoc2013-epiphany-ae4e4736818f442abd435274cb3b75f8da02ad33.tar.lz
gsoc2013-epiphany-ae4e4736818f442abd435274cb3b75f8da02ad33.tar.xz
gsoc2013-epiphany-ae4e4736818f442abd435274cb3b75f8da02ad33.tar.zst
gsoc2013-epiphany-ae4e4736818f442abd435274cb3b75f8da02ad33.zip
Don't set cookies from favicon downloads. Bug #337835.
2006-06-01 Jean-François Rameau <jframeau@cvs.gnome.org> * embed/ephy-embed-persist.h: * embed/ephy-favicon-cache.c: (ephy_favicon_cache_download): * embed/mozilla/EphySingle.cpp: (Init, Detach, ExamineCookies, ExamineResponse, ExamineRequest, Observe): * embed/mozilla/EphySingle.h: * embed/mozilla/MozDownload.cpp: (InitiateMozillaDownload): Don't set cookies from favicon downloads. Bug #337835.
Diffstat (limited to 'embed/mozilla/MozDownload.cpp')
-rw-r--r--embed/mozilla/MozDownload.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index 39fd8ee22..5c8ee71ec 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -52,6 +52,7 @@
#include <nsComponentManagerUtils.h>
#include <nsICancelable.h>
+#include <nsIChannel.h>
#include <nsIDOMDocument.h>
#include <nsIFileURL.h>
#include <nsIIOService.h>
@@ -60,8 +61,9 @@
#include <nsIObserver.h>
#include <nsIRequest.h>
#include <nsIURI.h>
-#include <nsIURI.h>
+#include <nsIWritablePropertyBag2.h>
#include <nsIWebBrowserPersist.h>
+
#include <nsMemory.h>
#include <nsNetError.h>
#include <nsServiceManagerUtils.h>
@@ -558,7 +560,20 @@ nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI
}
webPersist->SetPersistFlags(flags);
- if (!domDocument || !isHTML || ephy_flags & EPHY_EMBED_PERSIST_COPY_PAGE)
+ /* Create a new tagged channel if we need to block cookies from server */
+ if (ephy_flags & EPHY_EMBED_PERSIST_NO_COOKIES)
+ {
+ nsCOMPtr<nsIChannel> tmpChannel;
+ rv = ioService->NewChannelFromURI (sourceURI, getter_AddRefs (tmpChannel));
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ nsCOMPtr<nsIWritablePropertyBag2> props = do_QueryInterface(tmpChannel);
+ rv = props->SetPropertyAsBool (NS_LITERAL_STRING("epiphany-blocking-cookies"), PR_TRUE);
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ rv = webPersist->SaveChannel (tmpChannel, inDestFile);
+ }
+ else if (!domDocument || !isHTML || ephy_flags & EPHY_EMBED_PERSIST_COPY_PAGE)
{
rv = webPersist->SaveURI (sourceURI, aCacheKey, nsnull,
postData, nsnull, inDestFile);