10000 fix : 修改默认DB_DRIVER 为 mysql · APIJSON/hyperf-APIJSON@b1cf719 · GitHub
[go: up one dir, main page]

Skip to content

Commit b1cf719

Browse files
committed
fix : 修改默认DB_DRIVER 为 mysql
修改请求未带origin header头时的一个小问题
1 parent 381b676 commit b1cf719

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/Middleware/CorsMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CorsMiddleware
2020
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
2121
{
2222
$response = Context::get(ResponseInterface::class);
23-
$response = $response->withHeader('Access-Control-Allow-Origin', $request->getHeaders()['origin'])
23+
$response = $response->withHeader('Access-Control-Allow-Origin', $request->getHeaders()['origin']??'*')
2424
->withHeader('Access-Control-Allow-Credentials', 'true')
2525
->withHeader('Access-Control-Allow-Headers', 'DNT,Keep-Alive,User-Agent,Cache-Control,Content-Type,Authorization');
2626

config/autoload/databases.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
return [
1313
'default' => [
14-
'driver' => env('DB_DRIVER', 'pdo'),
14+
'driver' => env('DB_DRIVER', 'mysql'),
1515
'host' => env('DB_HOST', 'localhost'),
1616
'database' => env('DB_DATABASE', 'hyperf'),
1717
'port' => env('DB_PORT', 3306),

0 commit comments

Comments
 (0)
0