Compare commits
No commits in common. "9ef9c8454b7742763d5e4bc1872b63b0f2237187" and "16d1c9853be823a97cda621c2febb2c07719b38b" have entirely different histories.
9ef9c8454b
...
16d1c9853b
@ -13,6 +13,6 @@
|
||||
"TESTKEY"
|
||||
],
|
||||
"max-data": "10GB",
|
||||
"database": "database.json"
|
||||
"database": "databse.json"
|
||||
}
|
||||
```
|
||||
|
@ -4,7 +4,7 @@ import argparse
|
||||
import json
|
||||
from os.path import exists
|
||||
|
||||
from fastapi import FastAPI, Request, HTTPException, Query
|
||||
from fastapi import FastAPI, Request, HTTPException
|
||||
from fastapi.responses import StreamingResponse
|
||||
from fastapi import status
|
||||
from hypercorn.config import Config
|
||||
@ -32,7 +32,7 @@ if not exists(DATABASE):
|
||||
save_database(DATABASE, {'data-used': 0})
|
||||
|
||||
|
||||
api = FastAPI(docs_url=None, redoc_url=None)
|
||||
api = FastAPI()
|
||||
|
||||
|
||||
class MaxSizePerRequestError(Exception):
|
||||
@ -44,7 +44,7 @@ class MinSizePerRequestError(Exception):
|
||||
|
||||
|
||||
@api.get('/')
|
||||
def test_data(request: Request, size: str, api_key: str = Query(..., alias="api-key")) -> StreamingResponse:
|
||||
def test_data(api_key: str, size: str, request: Request) -> StreamingResponse:
|
||||
try:
|
||||
if api_key not in AUTHORIZED_KEYS:
|
||||
raise HTTPException(
|
||||
|
0
src/test.py
Normal file
0
src/test.py
Normal file
Loading…
Reference in New Issue
Block a user