comments
authorgggeek <giunta.gaetano@gmail.com>
Mon, 1 Jun 2020 10:00:53 +0000 (10:00 +0000)
committergggeek <giunta.gaetano@gmail.com>
Mon, 1 Jun 2020 10:00:53 +0000 (10:00 +0000)
NEWS
demo/server/discuss.php
demo/server/proxy.php
src/Server.php

diff --git a/NEWS b/NEWS
index 4f1f558..56c0938 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,8 @@
 XML-RPC for PHP version 4.4.2 - 2020/3/4
 
-* fixed: `client->setCookie()` bug: values that contain spaces are now properly encoded in a way that get decoded back
-  to spaces on the receiving end if that one is running on php 7.4 (or does RFC-compliant cookie decoding)
+* fixed: `client->setCookie()` bug: cookie values that contain spaces are now properly encoded in a way that gets them
+  decoded back to spaces on the receiving end if the server running on php 7.4 (or does RFC-compliant cookie decoding).
+  Beforehand we were encoding spaces to '+' characters.
 
 
 XML-RPC for PHP version 4.4.1 - 2019/7/29
index ac65209..5ecbe63 100644 (file)
@@ -85,6 +85,9 @@ function getComments($req)
     }
 }
 
+// NB: take care not to output anything else after this call, as it will mess up the responses and it will be hard to
+// debug. In case you have to do so, at least re-emit a correct Content-Length http header (requires output buffering)
+
 $srv = new PhpXmlRpc\Server(array(
     "discuss.addComment" => array(
         "function" => "addComment",
index 7f4d16c..453c9a4 100644 (file)
@@ -74,6 +74,8 @@ function forward_request($req)
 }
 
 // run the server
+// NB: take care not to output anything else after this call, as it will mess up the responses and it will be hard to
+// debug. In case you have to do so, at least re-emit a correct Content-Length http header (requires output buffering)
 $server = new PhpXmlRpc\Server(
     array(
         'xmlrpcproxy.call' => array(
index 406f056..bd21d68 100644 (file)
@@ -271,8 +271,10 @@ class Server
                 }
             }
 
-            // do not output content-length header if php is compressing output for us:
-            // it will mess up measurements
+            // Do not output content-length header if php is compressing output for us:
+            // it will mess up measurements.
+            // Note that Apache/mod_php will add (and even alter!) the Content-Length header on its own, but only for
+            // responses up to 8000 bytes
             if ($phpNoSelfCompress) {
                 header('Content-Length: ' . (int)strlen($payload));
             }