MDL-62584 xmlrpc: return correct content-length
authorMarina Glancy <marina@moodle.com>
Mon, 28 May 2018 03:14:42 +0000 (11:14 +0800)
committerMarina Glancy <marina@moodle.com>
Mon, 28 May 2018 03:14:42 +0000 (11:14 +0800)
webservice/xmlrpc/locallib.php

index fb888d9..92203e7 100644 (file)
@@ -133,8 +133,9 @@ class webservice_xmlrpc_server extends webservice_base_server {
      * @param Exception $ex
      */
     protected function send_error($ex = null) {
+        $this->response = $this->generate_error($ex);
         $this->send_headers();
-        echo $this->generate_error($ex);
+        echo $this->response;
     }
 
     /**