Remove unused test method and its associated code from ObdController
This commit is contained in:
@@ -420,37 +420,6 @@ class ObdController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Route::post('obd/store-test-data', [ObdController::class, 'test'])
|
|
||||||
public function test(Request $request)
|
|
||||||
{
|
|
||||||
$expectedUser = env('API_AUTH_USER');
|
|
||||||
$expectedPw = env('API_AUTH_PW');
|
|
||||||
|
|
||||||
$header_auth = $request->header('Authorization');
|
|
||||||
$expectedToken = $expectedUser . ':' . $expectedPw;
|
|
||||||
|
|
||||||
// if("Bearer " . $expectedToken != $header_auth)
|
|
||||||
// {
|
|
||||||
// return response("ERROR: Unauthorized", 403)
|
|
||||||
// ->header('Content-Type', 'text/plain');
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return response("Successfully Received", 200)->header('Content-Type', 'text/plain');
|
|
||||||
}
|
|
||||||
catch (\Exception $e)
|
|
||||||
{
|
|
||||||
//response("ERROR: Server error", 500)->header('Content-Type', 'text/plain');
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => 'Test internal server error : '.$e?->getCode()
|
|
||||||
], 500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function get_obd(Request $request)
|
public function get_obd(Request $request)
|
||||||
{
|
{
|
||||||
$expectedUser = env('API_AUTH_USER');
|
$expectedUser = env('API_AUTH_USER');
|
||||||
|
|||||||
Reference in New Issue
Block a user