Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 50c6bd5

Browse files
committed
Fixed route options not processed in ApplicationFactory
1 parent f529fea commit 50c6bd5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Container/ApplicationFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Zend\Expressive\Exception;
1818
use Zend\Expressive\Router\Aura as AuraRouter;
1919
use Zend\Expressive\Router\RouterInterface;
20+
use Zend\Expressive\Router\Route;
2021

2122
/**
2223
* Factory to use with an IoC container in order to return an Application instance.
@@ -167,11 +168,14 @@ private function injectRoutes(Application $app, ContainerInterface $container)
167168
? $spec['allowed_methods']
168169
: null;
169170
$name = isset($spec['name']) ? $spec['name'] : null;
170-
$route = $app->route($spec['path'], $spec['middleware'], $methods, $name);
171+
$methods = (null === $methods) ? Route::HTTP_METHOD_ANY : $methods;
172+
$route = new Route($spec['path'], $spec['middleware'], $methods, $name);
171173

172174
if (isset($spec['options']) && is_array($spec['options'])) {
173175
$route->setOptions($spec['options']);
174176
}
177+
178+
$app->route($route);
175179
}
176180
}
177181

0 commit comments

Comments
 (0)