Skip to content

Commit c61d23f

Browse files
authored
Update WebmanResponseTrait.php
1 parent 972c167 commit c61d23f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Traits/WebmanResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function success($data = [], $err_msg = 'success', $err_code = 200, $head
9595

9696
public function fail($err_msg = 'unknown error', $err_code = 400, $data = [], $headers = [])
9797
{
98-
if (! \request()->wantsJson()) {
98+
if (! \request()->expectsJson()) {
9999
$err_msg = \json_encode(compact('err_code', 'err_msg', 'data'), \JSON_UNESCAPED_SLASHES|\JSON_UNESCAPED_UNICODE|\JSON_PRETTY_PRINT);
100100
if (!array_key_exists($err_code, Response::$statusTexts)) {
101101
$err_code = 500;

0 commit comments

Comments
 (0)