Skip to content

Commit e2524be

Browse files
committed
Bugfix for #666
1 parent cfc7cf8 commit e2524be

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11123,7 +11123,7 @@ private static function from(int $status, string $contentType, string $content):
1112311123
$stream = $psr17Factory->createStream($content);
1112411124
$stream->rewind();
1112511125
$response = $response->withBody($stream);
11126-
$response = $response->withHeader('Content-Type', $contentType);
11126+
$response = $response->withHeader('Content-Type', $contentType . '; charset=utf-8');
1112711127
$response = $response->withHeader('Content-Length', strlen($content));
1112811128
return $response;
1112911129
}
@@ -11201,7 +11201,7 @@ public static function toString(ResponseInterface $response): string
1120111201
'username' => 'php-crud-api',
1120211202
'password' => 'php-crud-api',
1120311203
'database' => 'php-crud-api',
11204-
// d'debug' => false
11204+
// 'debug' => false
1120511205
]);
1120611206
$request = RequestFactory::fromGlobals();
1120711207
$api = new Api($config);

src/Tqdev/PhpCrudApi/ResponseFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private static function from(int $status, string $contentType, string $content):
4545
$stream = $psr17Factory->createStream($content);
4646
$stream->rewind();
4747
$response = $response->withBody($stream);
48-
$response = $response->withHeader('Content-Type', $contentType);
48+
$response = $response->withHeader('Content-Type', $contentType . '; charset=utf-8');
4949
$response = $response->withHeader('Content-Length', strlen($content));
5050
return $response;
5151
}

src/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'username' => 'php-crud-api',
1616
'password' => 'php-crud-api',
1717
'database' => 'php-crud-api',
18-
// d'debug' => false
18+
// 'debug' => false
1919
]);
2020
$request = RequestFactory::fromGlobals();
2121
$api = new Api($config);

0 commit comments

Comments
 (0)