Skip to content

Commit

Permalink
fix: 修复两个小bug
Browse files Browse the repository at this point in the history
  • Loading branch information
helloplhm-qwq committed Jan 13, 2024
1 parent a20367b commit 71dff0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/lx_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def generate_script_response(request):
oline = line
line = line.strip()
if (line.startswith('const API_URL')):
newScriptLines.append(f'const API_URL = "{request.scheme}://{request.host}"')
newScriptLines.append(f'''const API_URL = "{'https' if config.read_config('common.ssl_info.is_https') else 'http'}://{request.host}"''')
elif (line.startswith('const API_KEY')):
newScriptLines.append(f'const API_KEY = "{config.read_config("security.key.value")}"')
elif (line.startswith("* @name")):
Expand All @@ -103,10 +103,10 @@ async def generate_script_response(request):

return Response(text = r, content_type = 'text/javascript',
headers = {
'Content-Disposition': f'attachment; filename={
'Content-Disposition': f'''attachment; filename={
config.read_config("common.download_config.filename")
if config.read_config("common.download_config.filename").endswith(".js")
else (config.read_config("common.download_config.filename" + ".js"))}'
else (config.read_config("common.download_config.filename" + ".js"))}'''
})

if (config.read_config('common.allow_download_script')):
Expand Down
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import asyncio
import aiohttp
import time
import os

def handleResult(dic, status = 200):
return Response(body = json.dumps(dic, indent=2, ensure_ascii=False), content_type='application/json', status = status)
Expand Down

0 comments on commit 71dff0a

Please sign in to comment.