Fix for wrong web caching mechanism.

Wed, 05 Jun 2013 20:23:59 +0200

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Wed, 05 Jun 2013 20:23:59 +0200
changeset 2699
dd62671c6d5a
parent 2697
1cd7fa670b05
child 2701
7904fd3bc30d

Fix for wrong web caching mechanism.

Helpviewer/Network/NetworkAccessManager.py file | annotate | diff | comparison | revisions
diff -r 1cd7fa670b05 -r dd62671c6d5a Helpviewer/Network/NetworkAccessManager.py
--- a/Helpviewer/Network/NetworkAccessManager.py	Tue Jun 04 19:11:08 2013 +0200
+++ b/Helpviewer/Network/NetworkAccessManager.py	Wed Jun 05 20:23:59 2013 +0200
@@ -152,15 +152,19 @@
                 return reply
         
         # set cache policy
-        urlHost = req.url().host()
-        for host in Preferences.getHelp("NoCacheHosts"):
-            if host in urlHost:
+        if op == QNetworkAccessManager.GetOperation:
+            urlHost = req.url().host()
+            for host in Preferences.getHelp("NoCacheHosts"):
+                if host in urlHost:
+                    req.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
+                        QNetworkRequest.AlwaysNetwork)
+                    break
+            else:
                 req.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
-                    QNetworkRequest.AlwaysNetwork)
-                break
+                    Preferences.getHelp("CachePolicy"))
         else:
             req.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
-                Preferences.getHelp("CachePolicy"))
+                QNetworkRequest.AlwaysNetwork)
         
         # Do Not Track feature
         if self.__doNotTrack:

eric ide

mercurial