Skip to content

Commit

Permalink
fix 白屏问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xaoyaoo committed Feb 28, 2024
1 parent 5b4179a commit de5c6fa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pywxdump/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ def start_falsk(merge_path="", msg_path="", micro_path="", media_path="", wx_pat

CORS(app, resources={r"/*": {"origins": "*"}}, supports_credentials=True) # 允许所有域名跨域

@app.after_request
def changeHeader(response):
disposition = response.get_wsgi_headers('environ').get(
'Content-Disposition') or '' # 获取返回头文件名描述,如'inline; filename=index.562b9b5a.js'
if disposition.rfind('.js') == len(disposition) - 3:
response.mimetype = 'application/javascript'
return response

@app.before_request
def before_request():

Expand Down

0 comments on commit de5c6fa

Please sign in to comment.