From 1c47d87b6128950accc9b35d412e443a548503a0 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 31 Aug 2022 10:44:33 -0500 Subject: [PATCH] Fix nginx pdf --- judge/views/problem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge/views/problem.py b/judge/views/problem.py index 9e8038c..9cf20e9 100644 --- a/judge/views/problem.py +++ b/judge/views/problem.py @@ -409,7 +409,7 @@ class ProblemPdfDescriptionView(ProblemMixin, SingleObjectMixin, View): raise Http404() response = HttpResponse() if request.META.get("SERVER_SOFTWARE", "").startswith("nginx/"): - response["X-Accel-Redirect"] = problem.pdf_description + response["X-Accel-Redirect"] = problem.pdf_description.path else: with open(problem.pdf_description.path, "rb") as f: response.content = f.read()