提交 fd2df4ef 编写于 作者: qq_41256425's avatar qq_41256425

Update start.py

上级 ffd63187
......@@ -51,6 +51,16 @@ def get_video_resource(video_name):
return TOKEN_ERROR
return jsonify({ 'data': get_resource_by_token(token, video_name)})
@app.after_request
def change_header(resp):
file_type = resp.headers._list[0][1]
file_content_type = resp.headers._list[1][1]
if '.js' in str(file_type):
file_content_type = str(file_content_type).replace('text/plain', 'application/x-javascript')
content_type = (resp.headers._list[1][0], file_content_type)
resp.headers._list[1] = content_type
return resp
if __name__ == '__main__':
print(' * log path: ./service/resource/logs')
if 'service' in sys.argv:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册