[epiphany/gnome-40] Display PDFs from non-HTTP/HTTPS protocols



commit 5d661285b3b0c010bf58e8b918e5dd79b3cb6e4d
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
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1023>
    
    
    (cherry picked from commit 0ce5c704dcd1df367998489f3e9b03101978ea6c)

 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 44b1786ba..43e2a84b0 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -882,7 +882,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]