File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2916,7 +2916,7 @@ public function handle(Request $request): Response
2916
2916
$ headerName = $ this ->getProperty ('headerName ' , 'X-Requested-With ' );
2917
2917
$ headerValue = $ this ->getProperty ('headerValue ' , 'XMLHttpRequest ' );
2918
2918
if ($ headerValue != $ request ->getHeader ($ headerName )) {
2919
- return $ this ->responder ->error (ErrorCode::ONLY_AJAX_REQUESTS_ALLOWED , '' );
2919
+ return $ this ->responder ->error (ErrorCode::ONLY_AJAX_REQUESTS_ALLOWED , $ method );
2920
2920
}
2921
2921
}
2922
2922
return $ this ->next ->handle ($ request );
@@ -4279,7 +4279,7 @@ class ErrorCode
4279
4279
1015 => ["Operation '%s' not supported " , Response::METHOD_NOT_ALLOWED ],
4280
4280
1016 => ["Temporary or permanently blocked " , Response::FORBIDDEN ],
4281
4281
1017 => ["Bad or missing XSRF token " , Response::FORBIDDEN ],
4282
- 1018 => ["Only AJAX requests allowed " , Response::FORBIDDEN ],
4282
+ 1018 => ["Only AJAX requests allowed for '%s' " , Response::FORBIDDEN ],
4283
4283
];
4284
4284
4285
4285
public function __construct (int $ code )
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public function handle(Request $request): Response
17
17
$ headerName = $ this ->getProperty ('headerName ' , 'X-Requested-With ' );
18
18
$ headerValue = $ this ->getProperty ('headerValue ' , 'XMLHttpRequest ' );
19
19
if ($ headerValue != $ request ->getHeader ($ headerName )) {
20
- return $ this ->responder ->error (ErrorCode::ONLY_AJAX_REQUESTS_ALLOWED , '' );
20
+ return $ this ->responder ->error (ErrorCode::ONLY_AJAX_REQUESTS_ALLOWED , $ method );
21
21
}
22
22
}
23
23
return $ this ->next ->handle ($ request );
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class ErrorCode
51
51
1015 => ["Operation '%s' not supported " , Response::METHOD_NOT_ALLOWED ],
52
52
1016 => ["Temporary or permanently blocked " , Response::FORBIDDEN ],
53
53
1017 => ["Bad or missing XSRF token " , Response::FORBIDDEN ],
54
- 1018 => ["Only AJAX requests allowed " , Response::FORBIDDEN ],
54
+ 1018 => ["Only AJAX requests allowed for '%s' " , Response::FORBIDDEN ],
55
55
];
56
56
57
57
public function __construct (int $ code )
You can’t perform that action at this time.
0 commit comments