diff --git a/app/controllers/studip_controller.php b/app/controllers/studip_controller.php
index 5e9ab358908aebff9a6382672e5305dce8469aec..253557bc65ff38310e01d75d5bc0a55adfd1d152 100644
--- a/app/controllers/studip_controller.php
+++ b/app/controllers/studip_controller.php
@@ -11,6 +11,9 @@
 
 require_once __DIR__ . '/studip_response.php';
 
+/**
+ * @property StudipResponse $response
+ */
 abstract class StudipController extends Trails_Controller
 {
     protected $with_session = false; //do we need to have a session for this controller
@@ -407,8 +410,11 @@ abstract class StudipController extends Trails_Controller
      */
     public function render_json($data)
     {
+        $json = json_encode($data);
+
         $this->set_content_type('application/json;charset=utf-8');
-        return $this->render_text(json_encode($data));
+        $this->response->add_header('Content-Length', strlen($json));
+        $this->render_text($json);
     }
 
     /**