Archived
update: 添加了长度限制以免卡死服务端
This commit is contained in:
1 file changed
+2
@@ -16,6 +16,8 @@ template = Jinja2Templates('./src/templates')
|
|||||||
|
|
||||||
@main.get('/{name}')
|
@main.get('/{name}')
|
||||||
async def index(req: Request, name: str, length: int = 7, theme: str = 'lewd'):
|
async def index(req: Request, name: str, length: int = 7, theme: str = 'lewd'):
|
||||||
|
if length > 10:
|
||||||
|
return {'code': -200, 'msg': 'Length Error'}
|
||||||
response = await resp(name, length, theme)
|
response = await resp(name, length, theme)
|
||||||
|
|
||||||
return template.TemplateResponse('index.html', context={'request': req,
|
return template.TemplateResponse('index.html', context={'request': req,
|
||||||
|
|||||||
Reference in New Issue
Block a user