Fix prev commit
This commit is contained in:
parent
f373ecbc84
commit
28923f755b
1 changed files with 3 additions and 1 deletions
|
@ -451,7 +451,9 @@ class ProblemPdfDescriptionView(ProblemMixin, SingleObjectMixin, View):
|
|||
raise Http404()
|
||||
response = HttpResponse()
|
||||
if request.META.get("SERVER_SOFTWARE", "").startswith("nginx/"):
|
||||
response["X-Accel-Redirect"] = problem.pdf_description.path
|
||||
response["X-Accel-Redirect"] = os.path.join(
|
||||
settings.DMOJ_PROBLEM_DATA_ROOT, problem.pdf_description.path
|
||||
)
|
||||
else:
|
||||
with open(problem.pdf_description.path, "rb") as f:
|
||||
response.content = f.read()
|
||||
|
|
Loading…
Reference in a new issue