Chrome 60 xhr.getResponseHeader("Content-Range") returning undefined

368 views
Skip to first unread message

Donald Lord

unread,
Aug 9, 2017, 4:27:30 PM8/9/17
to PDFTron WebViewer
Hello,

Since Chrome 60 we've seen PDFNet failing to open XODs. We are presently using WebViewer v2.0.0 in production, but this problem also occurs in WebViewer v3.0.1.

In CoreControls.js there's an attempt to parse the "Content-Range" header which, due to changes outlined here: https://github.com/whatwg/xhr/issues/146, is returning undefined.

Since header-casing should be lowercase, the call should parse the "content-range" header.

I have replaced all associated references, eg:

e=d.request.getResponseHeader("Content-Range")

with

e = d.request.getResponseHeader("Content-Range") || d.request.getResponseHeader("content-range")

And have confirmed this works.

Justin Jung

unread,
Aug 11, 2017, 5:15:34 PM8/11/17
to PDFTron WebViewer on behalf of Donald Lord
Hello,

Thanks for pointing it out! The following build handles lowercase "content-range" header: http://www.pdftron.com/ID-zJWLuhTffd3c/WebViewer/WebViewer_3.0.1.61938.zip

Justin Jung
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages