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