]> git.mxchange.org Git - friendica.git/commitdiff
Fixing Response
authorPhilipp <admin@philipp.info>
Sun, 21 Nov 2021 22:46:57 +0000 (23:46 +0100)
committerPhilipp <admin@philipp.info>
Sat, 27 Nov 2021 11:40:57 +0000 (12:40 +0100)
src/Module/Response.php

index 9bf9912360aa8bf811eb4cd2db35a6c44fccc62a..29df82c04432cf2f1398a9cac023a5bcf82f015d 100644 (file)
@@ -100,18 +100,8 @@ class Response implements ICanCreateResponses
         */
        public function generate(): ResponseInterface
        {
-               $headers = [];
-
-               foreach ($this->headers as $key => $header) {
-                       if (empty($key)) {
-                               $headers[] = $header;
-                       } else {
-                               $headers[] = "$key: $header";
-                       }
-               }
-
                // Setting the response type as an X-header for direct usage
-               $headers['X-RESPONSE-TYPE'] = $this->type;
+               $this->headers['X-RESPONSE-TYPE'] = $this->type;
 
                return new \GuzzleHttp\Psr7\Response(200, $this->headers, $this->content);
        }