Skip to content

Commit ae3a5fc

Browse files
author
HungNA - Technical Manager
committed
Update v1.2.3
1 parent 8cf3b79 commit ae3a5fc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Middleware/BasicAuthWithCors.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ protected function acceptRequestRestful($origin, Request $request, Closure $next
3333
->header('Access - Control - Allow - Headers', 'Content - Type, Authorization');
3434
}
3535

36-
protected function errorResponse(Request $request)
36+
protected function errorResponse(Request $request, $method = '')
3737
{
3838
$response = [
3939
'error' => 'Cors Error',
40-
'origin' => $request->header('Origin') ?? null
40+
'origin' => $request->header('Origin') ?? null,
41+
'method' => $method
4142
];
4243
return response()->json($response, Response::HTTP_INTERNAL_SERVER_ERROR);
4344
}
@@ -74,6 +75,6 @@ public function handle(Request $request, Closure $next)
7475
}
7576
}
7677

77-
return $this->errorResponse($request);
78+
return $this->errorResponse($request, 'BasicAuthWithCors::handle');
7879
}
7980
}

0 commit comments

Comments
 (0)