diff options
| author | Jan Tuomi <jan.tuomi@eficode.com> | 2018-12-18 23:46:00 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan.tuomi@eficode.com> | 2018-12-18 23:46:00 +0200 |
| commit | e6b0cc4915f7648ec379408807c37d196543c610 (patch) | |
| tree | 3c8a876670ecd5fb28c37255af28146866ad53f3 /remote-https-runner | |
| parent | bc4ab2346f0e9b06c644c6cf4eb513963c8e8b8c (diff) | |
Refactormaster
Diffstat (limited to 'remote-https-runner')
| -rw-r--r-- | remote-https-runner/runner.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/remote-https-runner/runner.py b/remote-https-runner/runner.py index ef3f67f..1725404 100644 --- a/remote-https-runner/runner.py +++ b/remote-https-runner/runner.py @@ -28,6 +28,10 @@ config_keys = config.keys() def key(key): logging.info("User requested route \"{}\"".format(key)) + if not key in config_keys: + logging.warning("Route \"{}\" does not exist!".format(key)) + return Response("", status=404) + options = config[key] protocol = request.url.split("://")[0] logging.info("User uses protocol {}".format(protocol)) @@ -41,10 +45,6 @@ def key(key): logging.warning("User request rejected due to incorrect Authorization header!") return Response("", status=401) - if not key in config_keys: - logging.warning("Route \"{}\" does not exist!".format(key)) - return Response("", status=404) - if request.content_type != "application/json": logging.warning("User request rejected due to incorrect content type (must be application/json)!") return Response("", status=400) |
