fix: raise bad req error on call without X-API-key
This commit is contained in:
parent
8c5989d465
commit
2a4314ca84
1 changed files with 4 additions and 0 deletions
|
|
@ -96,6 +96,8 @@ async def get_key_type(r: Request,
|
||||||
await checker.__call__(r)
|
await checker.__call__(r)
|
||||||
return WalletTypeInfo(0, checker.wallet)
|
return WalletTypeInfo(0, checker.wallet)
|
||||||
except HTTPException as e:
|
except HTTPException as e:
|
||||||
|
if e.status_code == HTTPStatus.BAD_REQUEST:
|
||||||
|
raise
|
||||||
if e.status_code == HTTPStatus.UNAUTHORIZED:
|
if e.status_code == HTTPStatus.UNAUTHORIZED:
|
||||||
pass
|
pass
|
||||||
except:
|
except:
|
||||||
|
|
@ -106,6 +108,8 @@ async def get_key_type(r: Request,
|
||||||
await checker.__call__(r)
|
await checker.__call__(r)
|
||||||
return WalletTypeInfo(1, checker.wallet)
|
return WalletTypeInfo(1, checker.wallet)
|
||||||
except HTTPException as e:
|
except HTTPException as e:
|
||||||
|
if e.status_code == HTTPStatus.BAD_REQUEST:
|
||||||
|
raise
|
||||||
if e.status_code == HTTPStatus.UNAUTHORIZED:
|
if e.status_code == HTTPStatus.UNAUTHORIZED:
|
||||||
return WalletTypeInfo(2, None)
|
return WalletTypeInfo(2, None)
|
||||||
except:
|
except:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue