Maurits van der Schee 4 years ago
parent
commit
e2524bee3c
3 changed files with 4 additions and 4 deletions
  1. 2
    2
      api.php
  2. 1
    1
      src/Tqdev/PhpCrudApi/ResponseFactory.php
  3. 1
    1
      src/index.php

+ 2
- 2
api.php View File

11123
             $stream = $psr17Factory->createStream($content);
11123
             $stream = $psr17Factory->createStream($content);
11124
             $stream->rewind();
11124
             $stream->rewind();
11125
             $response = $response->withBody($stream);
11125
             $response = $response->withBody($stream);
11126
-            $response = $response->withHeader('Content-Type', $contentType);
11126
+            $response = $response->withHeader('Content-Type', $contentType . '; charset=utf-8');
11127
             $response = $response->withHeader('Content-Length', strlen($content));
11127
             $response = $response->withHeader('Content-Length', strlen($content));
11128
             return $response;
11128
             return $response;
11129
         }
11129
         }
11201
         'username' => 'php-crud-api',
11201
         'username' => 'php-crud-api',
11202
         'password' => 'php-crud-api',
11202
         'password' => 'php-crud-api',
11203
         'database' => 'php-crud-api',
11203
         'database' => 'php-crud-api',
11204
-        // d'debug' => false
11204
+        // 'debug' => false
11205
     ]);
11205
     ]);
11206
     $request = RequestFactory::fromGlobals();
11206
     $request = RequestFactory::fromGlobals();
11207
     $api = new Api($config);
11207
     $api = new Api($config);

+ 1
- 1
src/Tqdev/PhpCrudApi/ResponseFactory.php View File

45
         $stream = $psr17Factory->createStream($content);
45
         $stream = $psr17Factory->createStream($content);
46
         $stream->rewind();
46
         $stream->rewind();
47
         $response = $response->withBody($stream);
47
         $response = $response->withBody($stream);
48
-        $response = $response->withHeader('Content-Type', $contentType);
48
+        $response = $response->withHeader('Content-Type', $contentType . '; charset=utf-8');
49
         $response = $response->withHeader('Content-Length', strlen($content));
49
         $response = $response->withHeader('Content-Length', strlen($content));
50
         return $response;
50
         return $response;
51
     }
51
     }

+ 1
- 1
src/index.php View File

15
     'username' => 'php-crud-api',
15
     'username' => 'php-crud-api',
16
     'password' => 'php-crud-api',
16
     'password' => 'php-crud-api',
17
     'database' => 'php-crud-api',
17
     'database' => 'php-crud-api',
18
-    // d'debug' => false
18
+    // 'debug' => false
19
 ]);
19
 ]);
20
 $request = RequestFactory::fromGlobals();
20
 $request = RequestFactory::fromGlobals();
21
 $api = new Api($config);
21
 $api = new Api($config);

Loading…
Cancel
Save