From b47ce4fb240645ec7d50036da6d8352a8ca0f2e6 Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Sun, 18 Dec 2022 00:18:11 +0100 Subject: [PATCH] Use HTTPS for Google Books Images The API for Google Books will return HTTP image URLs when matiching any books using it as a search provider. In a secure environment, this causes browser warnings. All Google image links support HTTPS and we can safely switch to HTTOS to avoid these warnings. --- server/providers/GoogleBooks.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/providers/GoogleBooks.js b/server/providers/GoogleBooks.js index 94965f1e..69cc392e 100644 --- a/server/providers/GoogleBooks.js +++ b/server/providers/GoogleBooks.js @@ -20,7 +20,8 @@ class GoogleBooks { let cover = null // Selects the largest cover assuming the largest is the last key in the object if (imageLinks && Object.keys(imageLinks).length) { - cover = imageLinks[Object.keys(imageLinks).pop()] || null + cover = imageLinks[Object.keys(imageLinks).pop()] + cover = cover?.replace(/^http:/, 'https:') || null } return {