F fix bug

pull/22/head
vapao 2020-01-08 20:38:15 +08:00
parent bd8e9248dd
commit 1b8636536a
1 changed files with 6 additions and 4 deletions

View File

@ -211,6 +211,8 @@ def parse_text(request):
if error is None:
data = {}
for line in form.pop('data').split('\n'):
line = line.strip()
if line:
fields = line.split('=', 1)
if len(fields) != 2 or fields[0].strip() == '':
return json_response(error=f'解析配置{line!r}失败,确认其遵循 key = value 格式')