Skip to content

Commit a3586ef

Browse files
committed
Set the global "conditionalRequest" configuration value on the router.
This configuration key was never being set on the router meaning disabling it in the configuration or in the .env file would still result in 304 responses. Signed-off-by: Jason Lewis <[email protected]>
1 parent f747192 commit a3586ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Provider/ApiServiceProvider.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,18 @@ protected function registerRouter()
185185
$this->app->singleton('api.router', function ($app) {
186186
$config = $app['config']['api'];
187187

188-
return new Router(
188+
$router = new Router(
189189
$app['api.router.adapter'],
190190
new Http\Parser\Accept($config['standardsTree'], $config['subtype'], $config['version'], $config['defaultFormat']),
191191
$app['api.exception'],
192192
$app,
193193
$config['domain'],
194194
$config['prefix']
195195
);
196+
197+
$router->setConditionalRequest($config['conditionalRequest']);
198+
199+
return $router;
196200
});
197201

198202
$this->app->singleton('Dingo\Api\Routing\ResourceRegistrar', function ($app) {

0 commit comments

Comments
 (0)