mirror of
https://github.com/NovaOSS/nova-api.git
synced 2024-11-25 22:23:56 +01:00
Compare commits
1 commit
add32ac000
...
74da9607c5
Author | SHA1 | Date | |
---|---|---|---|
74da9607c5 |
|
@ -53,7 +53,7 @@ async def log_api_request(user: dict, incoming_request, target_url: str):
|
|||
|
||||
model = payload.get('model')
|
||||
ip_address = await network.get_ip(incoming_request)
|
||||
useragent = await replacer(incoming_request.headers.get('User-Agent', ''), UA_SIMPLIFY)
|
||||
useragent = await replacer(incoming_request.headers.get('User-Agent'), UA_SIMPLIFY)
|
||||
|
||||
new_log_item = {
|
||||
'timestamp': time.time(),
|
||||
|
|
|
@ -39,4 +39,4 @@ async def root():
|
|||
'core_api_docs_for_nova_developers': '/docs'
|
||||
}
|
||||
|
||||
app.add_route('/v1/{path:path}', transfer.handle, ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'])
|
||||
app.add_route('/{path:path}', transfer.handle, ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'])
|
||||
|
|
|
@ -116,7 +116,7 @@ async def stream(
|
|||
cookies=target_request.get('cookies'),
|
||||
ssl=False,
|
||||
timeout=aiohttp.ClientTimeout(
|
||||
connect=60,
|
||||
connect=3.0,
|
||||
total=float(os.getenv('TRANSFER_TIMEOUT', '120'))
|
||||
),
|
||||
) as response:
|
||||
|
|
|
@ -14,7 +14,7 @@ from helpers import tokens, errors
|
|||
|
||||
load_dotenv()
|
||||
|
||||
models_list = json.load(open('models.json', encoding='utf8'))
|
||||
models_list = json.load(open('models.json'))
|
||||
|
||||
with open('config/config.yml', encoding='utf8') as f:
|
||||
config = yaml.safe_load(f)
|
||||
|
@ -26,7 +26,7 @@ async def handle(incoming_request):
|
|||
Checks method, token amount, auth and cost along with if request is NSFW.
|
||||
"""
|
||||
users = UserManager()
|
||||
path = incoming_request.url.path
|
||||
path = incoming_request.url.path.replace('v1/v1/', 'v1/')
|
||||
|
||||
if '/models' in path:
|
||||
return fastapi.responses.JSONResponse(content=models_list)
|
||||
|
|
Loading…
Reference in a new issue