Pdf onebox showing file size as 0 bytes


(Christoph) #1

More a glitch than a bug, but anyway: URLs pointing to a pdf document are being oneboxed with a file size of 0 bytes. Otherwise the link works fine:


(Joffrey Jaffeux) #3

I gave it a look.

➜  onebox git:(wrong-pdf-filesize) ✗ curl --head "https://dspace.lboro.ac.uk/dspace-jspui/bitstream/2134/14294/3/greiffenhagen-ca_and_consumption.pdf"

HTTP/1.1 200 OK
Date: Mon, 07 Aug 2017 16:59:03 GMT
Server: Apache/2.2.3 (Red Hat)
Expires: Mon, 07 Aug 2017 16:59:03 GMT
Content-disposition: inline; filename=greiffenhagen-ca_and_consumption.pdf
Connection: close
Content-Type: application/pdf

The HEAD request is not returning a “content-length” for this specific file, my 2 cents is that we should just hide file size when it happens and not try to be too fancy. What do you think @techAPJ?


(Joffrey Jaffeux) #4

@techAPJ

I went ahead and created a PR following this idea, feel free to merge or delete.


(Jeff Atwood) #5