[Django]-PDF links getting stuck while loading in Chrome PDF Viewer

4👍

Looks like a bad content-type:

Content-Type:('application/pdf', None)

Check your code where you are assigning a content-type to the response. Looks like you’re sending a tuple instead of just application/pdf.

👤dgel

3👍

Like @dgel mentioned, your content type is incorrect:

$ curl -I http://ovsd.nutrislice.com/dbfiles/cms/resources/Vol5_Issue1_5_Dos_and_Donts_for_Supermarket_Survival.pdf
HTTP/1.1 200 OK
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Cache-Control: max-age=90000
Content-Type: ('application/pdf', None)       # <- Incorrect
Date: Fri, 09 Nov 2012 19:25:06 GMT
Expires: Fri, 09 Nov 2012 23:20:28 GMT
Last-Modified: Thu, 08 Nov 2012 22:20:28 GMT
Server: gunicorn/0.14.6
Connection: keep-alive

Also it might be a good idea to add Content-Length header.

Leave a comment