Skip to content

Commit

Permalink
Merge pull request #629 from nationalarchives/fix/do-not-always-use-w…
Browse files Browse the repository at this point in the history
…easyprint

Provoke AWS into sending Content-Length header
  • Loading branch information
dragon-dxw authored Apr 6, 2023
2 parents 5931694 + fd6c9ef commit ae66e60
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion judgments/views/detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ def detail_xml(_request, judgment_uri):

def get_pdf_size(judgment_uri):
"""Return the size of the S3 PDF for a judgment as a string in brackets, or an empty string if unavailable"""
response = requests.head(get_pdf_uri(judgment_uri))
response = requests.head(
get_pdf_uri(judgment_uri), headers={"Accept-Encoding": None}
)
content_length = response.headers.get("Content-Length", None)
if content_length:
filesize = filesizeformat(int(content_length))
Expand Down

0 comments on commit ae66e60

Please sign in to comment.