From 400c983025d359f8b89227462065b7fa925e8147 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Thu, 29 Dec 2022 20:41:02 +0100 Subject: [PATCH] added redirect for "/-/" route --- app/main.py | 7 ++++++- test/main.py | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index a29fd13..3f0b35f 100644 --- a/app/main.py +++ b/app/main.py @@ -63,7 +63,7 @@ def get_token(request: Request) -> dict: return jwt.decode(token=token, key=jwt_decode_key, algorithms=ALGORITHMS.RS256, options={'verify_aud': False}) -@app.get('/', summary='* Index') +@app.get('/', summary='Index') async def index(): return RedirectResponse('/-/readme') @@ -73,6 +73,11 @@ async def status(request: Request): return JSONResponse({'status': 'up', 'version': VERSION, 'commit': COMMIT, 'debug': DEBUG}) +@app.get('/-/', summary='* Index') +async def _index(): + return RedirectResponse('/-/readme') + + @app.get('/-/health', summary='* Health') async def _health(request: Request): return JSONResponse({'status': 'up', 'version': VERSION, 'commit': COMMIT, 'debug': DEBUG}) diff --git a/test/main.py b/test/main.py index 50f242b..9ef4457 100644 --- a/test/main.py +++ b/test/main.py @@ -67,6 +67,11 @@ def test_manage(): def test_client_token(): + response = client.get('/-/client-token') + assert response.status_code == 200 + + +def test_client_token_deprecated(): response = client.get('/client-token') assert response.status_code == 200