Compare commits
2 Commits
restructur
...
main
Author | SHA1 | Date | |
---|---|---|---|
3270e3fe2c | |||
f209e0e452 |
@ -26,6 +26,10 @@ BUFFER_SIZE = convert_to_bytes(CONFIG['buffer-size'])
|
||||
MAX_SIZE = convert_to_bytes(CONFIG['max-size'])
|
||||
MAX_DATA = convert_to_bytes(CONFIG['max-data'])
|
||||
AUTHORIZED_KEYS = CONFIG['keys']
|
||||
if isinstance(AUTHORIZED_KEYS, str):
|
||||
with open(AUTHORIZED_KEYS) as file:
|
||||
AUTHORIZED_KEYS = list(
|
||||
filter(lambda x: x.strip() != '', file.read().splitlines()))
|
||||
DATABASE = CONFIG['database']
|
||||
|
||||
if not exists(DATABASE):
|
||||
@ -43,7 +47,7 @@ class MinSizePerRequestError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
@api.get('/')
|
||||
@api.get('/zeros')
|
||||
async def test_data(api_key: str, size: str) -> StreamingResponse:
|
||||
try:
|
||||
if api_key not in AUTHORIZED_KEYS:
|
||||
|
Loading…
Reference in New Issue
Block a user