]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Response.php
New user account type "Channel Relay"
[friendica.git] / src / Module / Response.php
index f9d46da83b7c03679b188df009cb0f90075e5262..841902a55884bbf1050d580a2621db87d104ae33 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -89,7 +89,7 @@ class Response implements ICanCreateResponses
        /**
         * {@inheritDoc}
         */
-       public function setType(string $type, ?string $content_type = null): void
+       public function setType(string $type = Response::TYPE_HTML, ?string $content_type = null): void
        {
                if (!in_array($type, static::ALLOWED_TYPES)) {
                        throw new InternalServerErrorException('wrong type');
@@ -97,7 +97,7 @@ class Response implements ICanCreateResponses
 
                switch ($type) {
                        case static::TYPE_HTML:
-                               $content_type = $content_type ?? 'text/html';
+                               $content_type = $content_type ?? 'text/html; charset=utf-8';
                                break;
                        case static::TYPE_JSON:
                                $content_type = $content_type ?? 'application/json';