From 92d3de5b617568238888e8947593de679ad42299 Mon Sep 17 00:00:00 2001 From: Elias Rhouzlane Date: Sat, 18 Jan 2020 01:49:35 +0100 Subject: [PATCH] Add PDF viewer support --- lib/carlo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/carlo.js b/lib/carlo.js index 902e137..8f5d380 100644 --- a/lib/carlo.js +++ b/lib/carlo.js @@ -570,7 +570,7 @@ function contentType(request, fileName) { const dotIndex = fileName.lastIndexOf('.'); const extension = fileName.substr(dotIndex + 1); switch (request.resourceType()) { - case 'Document': return 'text/html'; + case 'Document': return extension === "pdf" ? 'application/pdf' : 'text/html'; case 'Script': return 'text/javascript'; case 'Stylesheet': return 'text/css'; case 'Image':