Actually send file contents when using FHOST_USE_X_ACCEL_REDIRECT
This commit is contained in:
parent
f66418ad4d
commit
984485d9cb
1 changed files with 1 additions and 1 deletions
2
fhost.py
2
fhost.py
|
|
@ -282,7 +282,7 @@ def get(path):
|
||||||
fsize = os.path.getsize(fpath)
|
fsize = os.path.getsize(fpath)
|
||||||
|
|
||||||
if app.config["FHOST_USE_X_ACCEL_REDIRECT"]:
|
if app.config["FHOST_USE_X_ACCEL_REDIRECT"]:
|
||||||
response = make_response()
|
response = make_response(open(fpath, "r").read(), 200)
|
||||||
response.headers["Content-Type"] = f.mime
|
response.headers["Content-Type"] = f.mime
|
||||||
response.headers["Content-Length"] = fsize
|
response.headers["Content-Length"] = fsize
|
||||||
response.headers["X-Accel-Redirect"] = "/" + fpath
|
response.headers["X-Accel-Redirect"] = "/" + fpath
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue