-
Notifications
You must be signed in to change notification settings - Fork 416
Closed
Labels
Milestone
Description
If I have a dynamically generated / custom served PDF (because I have to use URLs that expire and that verify security settings in the session before serving content) I have issues with the type detection:
This works as expected:
http://localhost:8080/Viewer.js/index.html#/test/pdf/demodoc.pdf
This does not work:
http://localhost:8080/Viewer.js/index.html#/test/pdf/demodoc.pdf?foo=bar
This hack with a parameter I don't look at forced on the end does:
http://localhost:8080/Viewer.js/index.html#/test/pdf/demodoc.pdf?foo=bar&type=.pdf
I think the problem is here:
function loadDocument(documentUrl) {
"use strict";
if (documentUrl) {
var extension = documentUrl.split('.').pop(),
this function assumes that there are no parameters
The following might fix this:
function loadDocument(documentUrl) {
"use strict";
if (documentUrl) {
var extension = documentUrl.split('?')[0].split('.').pop(),