Skip to content

Commit 23e0768

Browse files
committed
Handle 404 errors in API bindings correctly to avoid explosing that a resource exists before validating a key
1 parent a765e0d commit 23e0768

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
66
## v0.7.4 (Derelict Dermodactylus)
77
### Fixed
88
* Fixes a bug when reinstalling a server that would not mark the server as installing, resulting in some UI issues.
9+
* Handle 404 errors from missing models in the application API bindings correctly.
910

1011
## v0.7.3 (Derelict Dermodactylus)
1112
### Fixed

app/Http/Middleware/Api/ApiSubstituteBindings.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public function handle($request, Closure $next)
4545
$route = $request->route();
4646

4747
foreach (self::$mappings as $key => $model) {
48-
$this->router->model($key, $model);
48+
$this->router->model($key, $model, function () use ($request) {
49+
$request->attributes->set('is_missing_model', true);
50+
});
4951
}
5052

5153
$this->router->substituteBindings($route);

0 commit comments

Comments
 (0)