loadDocument HEAD calls

Hello there,
After upgrading to PDFJS Express 8.4.0 we noticed that our API start receiving an extra HEAD call when loading documents via documentViewer.loadDocument.

Is there an option that we can pass to the function to disable that or any other work-around?

Thank you

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi,

Ma I know if you’re loading from an extensionless URL or not? As the HEAD request is a request we make to determine the file type based on the mime-type header if there was no extension in the URL

Thanks.

Wanbo

Hello Wanbo, thanks for replying promptly.

Yes, the url we use does not include the extension, however after making changes and adding extension to that call I still observe the error in the console. Do I need to send the request with a reserved key or some other trick?

Thank you

Hi,

Could you attach your current code that how to load the document? Thanks.

Wanbo

documentViewer.loadDocument(pdfUrl,
            {
                onLoadingProgress: percent => {
                    if(this.state.loading) this.setState({ progress: percent * 100 })
                },
                extension: "pdf"
             }
        );

where pdfUrl doesn’t have the filename nor extension.

When I pass document url as https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf works fine and loads the document without extra head call. However, https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf will make an extra head call and display error.

Am I failing to see an obvious difference?

Thanks

Hi,

Could you attach the error you’re seeing? Thanks.

Wanbo