diff options
author | Joas Schilling <coding@schilljs.com> | 2019-07-08 17:07:06 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2019-08-28 11:28:06 +0300 |
commit | 3eec1b09dc56c015f3f07a63b4ab7d48ea6e2180 (patch) | |
tree | 35fbbdfc9cbe8b66deb99e685c2c846a8f377ac8 /lib | |
parent | ac1c1520b69ab77ee10d2086e5e3f48b366fab5c (diff) |
Use a different status code for lobby blocked requests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Middleware/InjectionMiddleware.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Middleware/InjectionMiddleware.php b/lib/Middleware/InjectionMiddleware.php index aa0b77f9d..bb22620fc 100644 --- a/lib/Middleware/InjectionMiddleware.php +++ b/lib/Middleware/InjectionMiddleware.php @@ -196,9 +196,16 @@ class InjectionMiddleware extends Middleware { return new RedirectToDefaultAppResponse(); } + if ($exception instanceof LobbyException) { + if ($controller instanceof OCSController) { + throw new OCSException('', Http::STATUS_PRECONDITION_FAILED); + } + + return new RedirectToDefaultAppResponse(); + } + if ($exception instanceof NotAModeratorException || - $exception instanceof ReadOnlyException || - $exception instanceof LobbyException) { + $exception instanceof ReadOnlyException) { if ($controller instanceof OCSController) { throw new OCSException('', Http::STATUS_FORBIDDEN); } |