[epiphany/mcatanzaro/non-http-pdf: 3/3] Display PDFs from non-HTTP/HTTPS protocols




commit 356ede64efbe4be169900ff1b9b12751df6540cc
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Mon Oct 18 14:08:06 2021 -0500

    Display PDFs from non-HTTP/HTTPS protocols
    
    We forced PDFs loaded via POST requests to become downloads to solve
    issue #1505, but forgot that PDFs can also be opened via other URI
    schemes. We shouldn't crash in this case. These can safely be loaded via
    PDF.js.
    
    Fixes #1611

 embed/ephy-web-view.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 0c9eccee3..27bff9a12 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -959,7 +959,7 @@ decide_policy_cb (WebKitWebView            *web_view,
       type = EPHY_WEB_VIEW_DOCUMENT_XML;
     } else if (strncmp (mime_type, "image/", 6) == 0) {
       type = EPHY_WEB_VIEW_DOCUMENT_IMAGE;
-    } else if (strcmp (mime_type, "application/pdf") == 0 && strcmp (method, "GET") == 0) {
+    } else if (strcmp (mime_type, "application/pdf") == 0 && (!method || strcmp (method, "GET") == 0)) {
       g_autofree char *pdf_uri = NULL;
 
       /* FIXME: figure out how to make PDFs work in iframes. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]