Handle 404 errors in API bindings correctly to avoid explosing that a resource exists before validating a key
This commit is contained in:
parent
a765e0dbb6
commit
23e07689a7
2 changed files with 4 additions and 1 deletions
|
@ -6,6 +6,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||||
## v0.7.4 (Derelict Dermodactylus)
|
## v0.7.4 (Derelict Dermodactylus)
|
||||||
### Fixed
|
### Fixed
|
||||||
* Fixes a bug when reinstalling a server that would not mark the server as installing, resulting in some UI issues.
|
* Fixes a bug when reinstalling a server that would not mark the server as installing, resulting in some UI issues.
|
||||||
|
* Handle 404 errors from missing models in the application API bindings correctly.
|
||||||
|
|
||||||
## v0.7.3 (Derelict Dermodactylus)
|
## v0.7.3 (Derelict Dermodactylus)
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -45,7 +45,9 @@ class ApiSubstituteBindings extends SubstituteBindings
|
||||||
$route = $request->route();
|
$route = $request->route();
|
||||||
|
|
||||||
foreach (self::$mappings as $key => $model) {
|
foreach (self::$mappings as $key => $model) {
|
||||||
$this->router->model($key, $model);
|
$this->router->model($key, $model, function () use ($request) {
|
||||||
|
$request->attributes->set('is_missing_model', true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->router->substituteBindings($route);
|
$this->router->substituteBindings($route);
|
||||||
|
|
Loading…
Reference in a new issue