Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException {#411 -statusCode: 405 -headers: array:1 [ "Allow" => "OPTIONS" ] }
{
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);
}
};
}
class FlushEventsMiddleware
{
public function handle(Request $request, Closure $next)
{
return $next($request);
}
public function terminate(Request $request, $response): void
{
Integration::flushEvents();
// 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 $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 ($psrRequest !== null) {
$container->instance(LaravelRequestFetcher::CONTAINER_PSR7_INSTANCE_KEY, $psrRequest);
}
}
return $next($request);
}
private function resolvePsrRequest(Container $container): ?ServerRequestInterface
{
try {
// 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);
}
};
};
public function handle(Request $request, Closure $next): Response
{
$this->logger->info('Request', $this->buildRequest($request));
/** @var Response $response */
$response = $next($request);
$response->headers->set(TokenStorage::TOKEN_HEADER, $this->tokenStorage->getToken());
return $response;
}
// 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);
}
};
};
$this->httpLoggerService->log($request);
} catch (Throwable $e) {
report($e);
}
return $next($request);
}
public function terminate(Request $request, Response $response): void
{
try {
// 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);
}
};
};
* @param Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @return Response|RedirectResponse
*/
public function handle(Request $request, Closure $next)
{
$response = $next($request);
if (extension_loaded('newrelic')) { // Ensure PHP agent is available
newrelic_name_transaction($this->getTransactionName($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);
}
};
};
{
$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'));
}
[$method, $pathInfo] = $this->parseIncomingRequest($request);
try {
$this->boot();
return $this->sendThroughPipeline($this->middleware, function ($request) use ($method, $pathInfo) {
$this->instance(Request::class, $request);
if (isset($this->router->getRoutes()[$method.$pathInfo])) {
return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]);
}
* @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 /var/www/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237 at Laravel\Lumen\Application->handleDispatcherResponse(array(2, array('OPTIONS'))) (/var/www/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:174) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(object(Request)) (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:48) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) (/var/www/html/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/FlushEventsMiddleware.php:13) at Sentry\Laravel\Http\FlushEventsMiddleware->handle(object(Request), object(Closure)) (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) (/var/www/html/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php:45) at Sentry\Laravel\Http\SetRequestIpMiddleware->handle(object(Request), object(Closure)) (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) (/var/www/html/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php:31) at Sentry\Laravel\Http\SetRequestMiddleware->handle(object(Request), object(Closure)) (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) (/var/www/html/vendor/taker-io/lib-logger/src/Middlewares/LaravelHttpLogMiddleware.php:28) at TakerIo\Logger\Middlewares\LaravelHttpLogMiddleware->handle(object(Request), object(Closure)) (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) (/var/www/html/app/Http/Middleware/HttpLoggerMiddleware.php:26) at App\Http\Middleware\HttpLoggerMiddleware->handle(object(Request), object(Closure)) (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) (/var/www/html/app/Http/Middleware/NewRelicTransactionName.php:21) at App\Http\Middleware\NewRelicTransactionName->handle(object(Request), object(Closure)) (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (/var/www/html/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:116) at Illuminate\Pipeline\Pipeline->then(object(Closure)) (/var/www/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:428) at Laravel\Lumen\Application->sendThroughPipeline(array('App\\Http\\Middleware\\NewRelicTransactionName', 'App\\Http\\Middleware\\HttpLoggerMiddleware', 'TakerIo\\Logger\\Middlewares\\LaravelHttpLogMiddleware', 'Sentry\\Laravel\\Http\\SetRequestMiddleware', 'Sentry\\Laravel\\Http\\SetRequestIpMiddleware', 'Sentry\\Laravel\\Http\\FlushEventsMiddleware'), object(Closure)) (/var/www/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:167) at Laravel\Lumen\Application->dispatch(null) (/var/www/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112) at Laravel\Lumen\Application->run() (/var/www/html/public/index.php:28) |