mirror of
https://github.com/NovaOSS/nova-api.git
synced 2024-11-25 14:43:58 +01:00
Add system fingerprint to server JSON response
This commit is contained in:
parent
b14383be3d
commit
b79ebc05b8
|
@ -62,7 +62,7 @@ async def handle(incoming_request: fastapi.Request):
|
|||
user = await users.user_by_api_key(received_key.split('Bearer ')[1].strip())
|
||||
|
||||
if not user or not user['status']['active']:
|
||||
return await errors.error(418, 'Invalid or inactive NovaAI API key!', 'Create a new NovaOSS API key or reactivate your account.')
|
||||
return await errors.error(401, 'Invalid or inactive NovaAI API key!', 'Try /resetkey or /credentials.')
|
||||
|
||||
ban_reason = user['status']['ban_reason']
|
||||
if ban_reason:
|
||||
|
|
|
@ -241,6 +241,7 @@ async def respond(
|
|||
return
|
||||
|
||||
if (not is_stream) and server_json_response:
|
||||
server_json_response['system_fingerprint'] = f'fp_' + os.urandom(5).hex()
|
||||
yield json.dumps(server_json_response)
|
||||
|
||||
if incoming_request: # not called by other code, but actually a request
|
||||
|
|
Loading…
Reference in a new issue