From 59fd4afe27bfd0a329e6739e057d6921b8328d8a Mon Sep 17 00:00:00 2001 From: Amine Mouafik Date: Sat, 22 Feb 2020 02:56:03 +0100 Subject: Review Custom Website URL validation --- uncompressed/franz-custom-website/index.js | 7 ++----- uncompressed/franz-custom-website/package.json | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'uncompressed') diff --git a/uncompressed/franz-custom-website/index.js b/uncompressed/franz-custom-website/index.js index 47da782..86c3227 100644 --- a/uncompressed/franz-custom-website/index.js +++ b/uncompressed/franz-custom-website/index.js @@ -4,12 +4,9 @@ module.exports = Franz => class CustomWebsite extends Franz { async validateUrl(url) { try { const resp = await window.fetch(url, { - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } + method: 'GET' }); - return resp.status.toString().startsWith('2') || resp.status.toString().startsWith('3'); + return resp.status.toString().startsWith('2'); } catch (err) { console.error(err); } diff --git a/uncompressed/franz-custom-website/package.json b/uncompressed/franz-custom-website/package.json index 6c40697..457a8a1 100644 --- a/uncompressed/franz-custom-website/package.json +++ b/uncompressed/franz-custom-website/package.json @@ -1,7 +1,7 @@ { "id": "franz-custom-website", "name": "Custom Website", - "version": "1.0.1", + "version": "1.0.2", "description": "Add a custom website to Franz", "main": "index.js", "author": "Stefan Malzner ", -- cgit v1.2.3-70-g09d2 From f7422c3a9a02553991e9b96d03b76aed1173e71c Mon Sep 17 00:00:00 2001 From: Amine Mouafik Date: Sat, 22 Feb 2020 21:34:12 +0100 Subject: Validate all https responses different from 4xx --- franz-custom-website.tar.gz | Bin 5541 -> 5558 bytes uncompressed/franz-custom-website/index.js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'uncompressed') diff --git a/franz-custom-website.tar.gz b/franz-custom-website.tar.gz index a2d7879..68153e2 100644 Binary files a/franz-custom-website.tar.gz and b/franz-custom-website.tar.gz differ diff --git a/uncompressed/franz-custom-website/index.js b/uncompressed/franz-custom-website/index.js index 86c3227..62f4218 100644 --- a/uncompressed/franz-custom-website/index.js +++ b/uncompressed/franz-custom-website/index.js @@ -6,7 +6,7 @@ module.exports = Franz => class CustomWebsite extends Franz { const resp = await window.fetch(url, { method: 'GET' }); - return resp.status.toString().startsWith('2'); + return !resp.status.toString().startsWith('4'); } catch (err) { console.error(err); } -- cgit v1.2.3-70-g09d2