Actually send file contents when using FHOST_USE_X_ACCEL_REDIRECT

This commit is contained in:
The Stranjer 2019-12-18 18:34:03 -05:00
parent f66418ad4d
commit 984485d9cb

View file

@ -282,7 +282,7 @@ def get(path):
fsize = os.path.getsize(fpath)
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-Length"] = fsize
response.headers["X-Accel-Redirect"] = "/" + fpath