Digital object file size appears as "NaN undefined" in Firefox
Closed this issue · 1 comments
HaSistrunk commented
Describe the bug
In Firefox, the file size for a digital object does not display. Instead of the size, it is displaying it is a not-a-number undefined.
To reproduce
Steps to reproduce the behavior:
- Navigate to an object with a digital object available to view using the Firefox browser: https://dimes.rockarch.org/objects/SyeUfA7RSXAfpd6uCsCdnM
- See the details about the object
- Notice that instead of digital object file size, "NaN undefined" is displayed
- Compare to Chrome and Safari, which have the file size info available.
Error message or screenshots
helrond commented
This was happening because the content-length
header was not part of the response for a HEAD
request made in Firefox (but that header was returned in Chrome and Safari). It seems like browsers may implement CORS headers differently. Content-length
is supposed to be one of the CORS safelisted response headers but apparently it wasn't part of that list originally, so 🤷
After explicitly setting content-length
to be exposed on the resources being requested (PDFs) in AWS S3 this problem was resolved.