summaryrefslogtreecommitdiff
path: root/x11/kdelibs4/files/patch-kioslave_http-http.cc
blob: 73929be6efcf9a749a969277154cf89e74a451a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- kioslave/http/http.cc	2007/09/26 17:08:43	717341
+++ kioslave/http/http.cc	2007/10/17 04:11:51	726097
@@ -3409,10 +3409,6 @@
 
   } while (!m_bEOF && (len || noHeader) && (headerSize < maxHeaderSize) && (gets(buffer, sizeof(buffer)-1)));
 
-  // Send the current response before processing starts or it
-  // might never get sent...
-  forwardHttpResponseHeader();
-
   // Now process the HTTP/1.1 upgrade
   QStringList::Iterator opt = upgradeOffers.begin();
   for( ; opt != upgradeOffers.end(); ++opt) {
@@ -3818,6 +3814,10 @@
     mimeType( m_strMimeType );
   }
 
+  // Do not move send response header before any redirection as it seems
+  // to screw up some sites. See BR# 150904.
+  forwardHttpResponseHeader();
+
   if (m_request.method == HTTP_HEAD)
      return true;
 
@@ -3830,10 +3830,10 @@
         // Check...
         createCacheEntry(m_strMimeType, expireDate); // Create a cache entry
         if (!m_request.fcache)
-	    {
-		m_request.bCachedWrite = false; // Error creating cache entry.
-		kdDebug(7113) << "(" << m_pid << ") Error creating cache entry for " << m_request.url.url()<<"!\n";
-	    }
+        {
+          m_request.bCachedWrite = false; // Error creating cache entry.
+          kdDebug(7113) << "(" << m_pid << ") Error creating cache entry for " << m_request.url.url()<<"!\n";
+        }
         m_request.expireDate = expireDate;
         m_maxCacheSize = config()->readNumEntry("MaxCacheSize", DEFAULT_MAX_CACHE_SIZE) / 2;
      }