Fix HTTP headers
This commit is contained in:
parent
5778605417
commit
fea37bc512
@ -62,7 +62,7 @@ class Handler extends ExceptionHandler
|
||||
if ($e instanceof ValidationException) {
|
||||
// Quick fix for returning 422
|
||||
// @see https://prinzeugen.net/custom-responses-of-laravel-validations/
|
||||
if ($request->expectsJson() || $request->ajax()) {
|
||||
if ($request->expectsJson()) {
|
||||
return response()->json([
|
||||
'errno' => 1,
|
||||
'msg' => $e->validator->errors()->first()
|
||||
|
@ -5,6 +5,7 @@ const empty = Object.create(null);
|
||||
const init = {
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user