• 1000
File src/Application.php
public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
{
$middlewareQueue
// Catch any exceptions in the lower layers,
// and make an error page/response
->add(new ErrorHandlerMiddleware(Configure::read('Error')))
// Handle plugin/theme assets like CakePHP normally does.
->add(new AssetMiddleware([
'cacheTime' => Configure::read('Asset.cacheTime'),
]))
// Add routing middleware.
// If you have a large number of routes connected, turning on routes
// caching in production could improve performance. For that when
// creating the middleware instance specify the cache config name by
// using it's second constructor argument:
// `new RoutingMiddleware($this, '_cake_routes_')`
->add(new RoutingMiddleware($this))
// Parse various types of encoded request bodies so that they are
// available as array through $request->getData()
// https://book.cakephp.org/4/en/controllers/middleware.html#body-parser-middleware
->add(new HttpsEnforcerMiddleware([
'HttpsEnforcerMiddleware' => true,'headers' => ['X-Https-Upgrade' => true],'statusCode' => 302
]))
->add(new BodyParserMiddleware());
return $middlewareQueue;
}
Журнал ошибок:
2020-05-06 20:04:44 Error: [Cake\Http\Exception\BadRequestException] Bad Request in xxxxxxx/vendor/cakephp/cakephp/src/Controller/Component/FormProtectionComponent.php on line 141
Stack Trace:
- xxxxxxx/vendor/cakephp/cakephp/src/Controller/Component/FormProtectionComponent.php:95
- xxxxxxx/vendor/cakephp/cakephp/src/Event/EventManager.php:309
- xxxxxxx/vendor/cakephp/cakephp/src/Event/EventManager.php:286
- xxxxxxx/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php:92
- xxxxxxx/vendor/cakephp/cakephp/src/Controller/Controller.php:569
- xxxxxxx/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php:72
- xxxxxxx/vendor/cakephp/cakephp/src/Http/BaseApplication.php:229
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Runner.php:77
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php:164
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Runner.php:73
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Middleware/HttpsEnforcerMiddleware.php:81
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Runner.php:73
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Runner.php:77
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php:137
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Runner.php:73
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Runner.php:58
- xxxxxxx/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php:162
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Runner.php:73
- xxxxxxx/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php:68
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Runner.php:73
- xxxxxxx/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php:119
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Runner.php:73
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Runner.php:58
- xxxxxxx/vendor/cakephp/cakephp/src/Http/Server.php:90
- xxxxxxx/webroot/index.php:40
Обновлена трассировка стека (версия 2)