summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@redhat.com>2021-10-18 14:08:06 -0500
committerMichael Catanzaro <mcatanzaro@gnome.org>2021-10-24 16:38:41 +0000
commit5d661285b3b0c010bf58e8b918e5dd79b3cb6e4d (patch)
tree06541175bff0af60ba91b849cd3dfef18b27edd9
parented348e4b25c224b38a8f5eb5ced2044ffa66e898 (diff)
downloadepiphany-5d661285b3b0c010bf58e8b918e5dd79b3cb6e4d.tar.gz
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)
-rw-r--r--embed/ephy-web-view.c2
1 files changed, 1 insertions, 1 deletions
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. */