Symfony Exception

MethodNotAllowedHttpException

HTTP 405 Method Not Allowed

Exception

Symfony\Component\HttpKernel\Exception\ MethodNotAllowedHttpException

  1.     {
  2.         switch ($routeInfo[0]) {
  3.             case Dispatcher::NOT_FOUND:
  4.                 throw new NotFoundHttpException;
  5.             case Dispatcher::METHOD_NOT_ALLOWED:
  6.                 throw new MethodNotAllowedHttpException($routeInfo[1]);
  7.             case Dispatcher::FOUND:
  8.                 return $this->handleFoundRoute($routeInfo);
  9.         }
  10.     }
  1.                 if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  2.                     return $this->handleFoundRoute([true$this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  3.                 }
  4.                 return $this->handleDispatcherResponse(
  5.                     $this->createDispatcher()->dispatch($method$pathInfo)
  6.                 );
  7.             });
  8.         } catch (Throwable $e) {
  9.             return $this->prepareResponse($this->sendExceptionToHandler($e));
  10.         }
  1.      */
  2.     protected function prepareDestination(BaseClosure $destination)
  3.     {
  4.         return function ($passable) use ($destination) {
  5.             try {
  6.                 return $destination($passable);
  7.             } catch (Throwable $e) {
  8.                 return $this->handleException($passable$e);
  9.             }
  10.         };
  11.     }
Pipeline->Laravel\Lumen\Routing\{closure}() in /data/www/webroot/app/Http/Middleware/OrgAdminForwardMiddleware.php (line 32)
  1.         if (isset($result['forward'])) {
  2.             unset($result['forward']);
  3.             return response($result);
  4.         }
  5.         return $next($request);
  6.     }
  7.     /**
  8.      * @param Request $request
  9.      * @return array
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
Pipeline->Laravel\Lumen\Routing\{closure}() in /data/www/webroot/app/Http/Middleware/LogTraceMiddleware.php (line 20)
  1.     {
  2.         $traceId $request->server->get('HTTP_TRACE_ID'TRACE_ID);
  3.         if (!defined('TRUE_TRACE_ID')) {
  4.             define('TRUE_TRACE_ID'$traceId);
  5.         }
  6.         return $next($request);
  7.     }
  8. }
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
Pipeline->Laravel\Lumen\Routing\{closure}() in /data/www/webroot/app/Http/Middleware/CorsMiddleware.php (line 30)
  1.                 'Access-Control-Max-Age' => 172000,
  2.             ];
  3.             return response(''200$headers);
  4.         }
  5.         /** @var Response $response */
  6.         $response $next($request);
  7.         $response->headers->set('Access-Control-Allow-Origin'$origin);
  8.         $response->headers->set('Access-Control-Allow-Credentials''true');
  9.         $response->headers->set(
  10.             'Access-Control-Allow-Headers',
  11.             'Origin,X-Requested-With,Content-Type,Accept,Authorization'
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
Pipeline->Laravel\Lumen\Routing\{closure}() in /data/www/webroot/app/Http/Middleware/ResponseMiddleware.php (line 44)
  1.      * @return JsonResponse|Response|mixed
  2.      */
  3.     public function handle(Request $requestClosure $next)
  4.     {
  5.         /** @var Response $response */
  6.         $response $next($request);
  7.         // 是否是文件流
  8.         if (in_array(strtolower($response->headers->get('Content-Type')), ['application/octet-stream''text/plain'])) {
  9.             return $response;
  10.         }
  11.         // excel导出
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
Pipeline->Laravel\Lumen\Routing\{closure}() in /data/www/webroot/app/Http/Middleware/InsideLimitMiddleware.php (line 35)
  1.             if ($ex->getCode() == 1459527) {
  2.                 die('接口限制访问');
  3.             }
  4.             MLogger::error("InsideApiLimit""限制模块处理错误", ['err' => $ex->getMessage()]);
  5.         }
  6.         return $next($request);
  7.     }
  8. }
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
Pipeline->Laravel\Lumen\Routing\{closure}() in /data/www/webroot/app/Http/Middleware/RedirectDetailMiddleware.php (line 42)
  1.     {
  2.         if (in_array($_SERVER['HTTP_HOST'], ['z.wpt.la''http://z.wpt.la''https://z.wpt.la'])) {
  3.             Log::info('redirectDetailMiddleware''中转进来了'$_SERVER);
  4.             $this->redirectDetail();
  5.         }
  6.         return $next($request);
  7.     }
  8.     public function redirectDetail()
  9.     {
  10.         $env config('app.env');
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
in /data/www/webroot/vendor/illuminate/pipeline/Pipeline.php -> Laravel\Lumen\Routing\{closure} (line 103)
  1.     {
  2.         $pipeline array_reduce(
  3.             array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  4.         );
  5.         return $pipeline($this->passable);
  6.     }
  7.     /**
  8.      * Run the pipeline and return the result.
  9.      *
  1.     {
  2.         if (count($middleware) > && ! $this->shouldSkipMiddleware()) {
  3.             return (new Pipeline($this))
  4.                 ->send($this->make('request'))
  5.                 ->through($middleware)
  6.                 ->then($then);
  7.         }
  8.         return $then($this->make('request'));
  9.     }
  1.                 }
  2.                 return $this->handleDispatcherResponse(
  3.                     $this->createDispatcher()->dispatch($method$pathInfo)
  4.                 );
  5.             });
  6.         } catch (Throwable $e) {
  7.             return $this->prepareResponse($this->sendExceptionToHandler($e));
  8.         }
  9.     }
  1.      * @param  \Symfony\Component\HttpFoundation\Request|null  $request
  2.      * @return void
  3.      */
  4.     public function run($request null)
  5.     {
  6.         $response $this->dispatch($request);
  7.         if ($response instanceof SymfonyResponse) {
  8.             $response->send();
  9.         } else {
  10.             echo (string) $response;
Application->run() in /data/www/webroot/public/index.php (line 30)
  1. | the client's browser allowing them to enjoy the creative
  2. | and wonderful application we have prepared for them.
  3. |
  4. */
  5. $app->run();

Stack Trace

MethodNotAllowedHttpException
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException:

  at /data/www/webroot/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:235
  at Laravel\Lumen\Application->handleDispatcherResponse()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:173)
  at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:48)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/data/www/webroot/app/Http/Middleware/OrgAdminForwardMiddleware.php:32)
  at App\Http\Middleware\OrgAdminForwardMiddleware->handle()
     (/data/www/webroot/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/data/www/webroot/app/Http/Middleware/LogTraceMiddleware.php:20)
  at App\Http\Middleware\LogTraceMiddleware->handle()
     (/data/www/webroot/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/data/www/webroot/app/Http/Middleware/CorsMiddleware.php:30)
  at App\Http\Middleware\CorsMiddleware->handle()
     (/data/www/webroot/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/data/www/webroot/app/Http/Middleware/ResponseMiddleware.php:44)
  at App\Http\Middleware\ResponseMiddleware->handle()
     (/data/www/webroot/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/data/www/webroot/app/Http/Middleware/InsideLimitMiddleware.php:35)
  at App\Http\Middleware\InsideLimitMiddleware->handle()
     (/data/www/webroot/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/data/www/webroot/app/Http/Middleware/RedirectDetailMiddleware.php:42)
  at App\Http\Middleware\RedirectDetailMiddleware->handle()
     (/data/www/webroot/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/data/www/webroot/vendor/illuminate/pipeline/Pipeline.php:103)
  at Illuminate\Pipeline\Pipeline->then()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426)
  at Laravel\Lumen\Application->sendThroughPipeline()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:175)
  at Laravel\Lumen\Application->dispatch()
     (/data/www/webroot/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112)
  at Laravel\Lumen\Application->run()
     (/data/www/webroot/public/index.php:30)