diff options
author | NavaL <ayoyo@thoughtworks.com> | 2016-09-26 13:14:47 +0200 |
---|---|---|
committer | NavaL <ayoyo@thoughtworks.com> | 2016-09-26 13:14:47 +0200 |
commit | bc82002e703118b2347c59106080da03ea69b5c8 (patch) | |
tree | d87376d822d6a69ad2039179751957cea95b835b /service/pixelated/resources | |
parent | 4462f7f8ca4b0e22396ef3a82cee884f8d348276 (diff) |
Ensuring 503 is thrown whenever the root_resource is not yet initialized, for all cases, not just when it is csrf valid.
Issue #684
Diffstat (limited to 'service/pixelated/resources')
-rw-r--r-- | service/pixelated/resources/root_resource.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/service/pixelated/resources/root_resource.py b/service/pixelated/resources/root_resource.py index 8353ed7e..54fe7b4a 100644 --- a/service/pixelated/resources/root_resource.py +++ b/service/pixelated/resources/root_resource.py @@ -60,11 +60,10 @@ class RootResource(BaseResource): def getChild(self, path, request): if path == '': return self + if self._mode == MODE_STARTUP: + return UnavailableResource() if self._is_xsrf_valid(request): - if self._mode == MODE_RUNNING: - return self._child_resources.get(path) - else: - return UnavailableResource() + return self._child_resources.get(path) return UnAuthorizedResource() def _is_xsrf_valid(self, request): |