Update case sensitif
This commit is contained in:
@@ -26,11 +26,11 @@ class Authentication
|
|||||||
// Add language
|
// Add language
|
||||||
if(!$locale)
|
if(!$locale)
|
||||||
{
|
{
|
||||||
return ApiResponse::apiResponse('Unauthorized', null, trans('validation.required', ['attribute' => 'Accept-Language']), 401);
|
return ApiResponse::apiResponse('Unauthorized', null, trans('Validation.required', ['attribute' => 'Accept-Language']), 401);
|
||||||
}
|
}
|
||||||
if($locale !== 'en-US' && $locale !== 'id-ID')
|
if($locale !== 'en-US' && $locale !== 'id-ID')
|
||||||
{
|
{
|
||||||
return ApiResponse::apiResponse('Bad Request', null, trans('validation.invalid', ['attribute' => 'Accept-Language']), 400);
|
return ApiResponse::apiResponse('Bad Request', null, trans('Validation.invalid', ['attribute' => 'Accept-Language']), 400);
|
||||||
}
|
}
|
||||||
if ($locale === 'en-US')
|
if ($locale === 'en-US')
|
||||||
{
|
{
|
||||||
@@ -46,19 +46,19 @@ class Authentication
|
|||||||
// Validate type accept & content type
|
// Validate type accept & content type
|
||||||
if (!$acceptHeader)
|
if (!$acceptHeader)
|
||||||
{
|
{
|
||||||
return ApiResponse::apiResponse('Unauthorized', null, trans('validation.required', ['attribute' => 'Accept']), 401);
|
return ApiResponse::apiResponse('Unauthorized', null, trans('Validation.required', ['attribute' => 'Accept']), 401);
|
||||||
}
|
}
|
||||||
if (!$contentType)
|
if (!$contentType)
|
||||||
{
|
{
|
||||||
return ApiResponse::apiResponse('Unauthorized', null, trans('validation.required', ['attribute' => 'Content-Type']), 401);
|
return ApiResponse::apiResponse('Unauthorized', null, trans('Validation.required', ['attribute' => 'Content-Type']), 401);
|
||||||
}
|
}
|
||||||
if ($acceptHeader !== 'application/json')
|
if ($acceptHeader !== 'application/json')
|
||||||
{
|
{
|
||||||
return ApiResponse::apiResponse('Bad Request', null, trans('validation.invalid', ['attribute' => 'Accept']), 400);
|
return ApiResponse::apiResponse('Bad Request', null, trans('Validation.invalid', ['attribute' => 'Accept']), 400);
|
||||||
}
|
}
|
||||||
if($contentType !== 'application/json')
|
if($contentType !== 'application/json')
|
||||||
{
|
{
|
||||||
return ApiResponse::apiResponse('Bad Request', null, trans('validation.invalid', ['attribute' => 'Content-Type']), 400);
|
return ApiResponse::apiResponse('Bad Request', null, trans('Validation.invalid', ['attribute' => 'Content-Type']), 400);
|
||||||
}
|
}
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user