aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Amine <amine@mouafik.fr>2020-02-23 12:24:14 +0100
committerLibravatar GitHub <noreply@github.com>2020-02-23 12:24:14 +0100
commit938961ca57a3d4d01b6bb7d15fedda66dec7def1 (patch)
tree8a07dddd4588f27ec389a6c0aac9cb27adba81b4
parentRemove unneeded workflows (diff)
parentRe-add wrongly deleted hackmd.tar.gz (diff)
downloadferdium-recipes-938961ca57a3d4d01b6bb7d15fedda66dec7def1.tar.gz
ferdium-recipes-938961ca57a3d4d01b6bb7d15fedda66dec7def1.tar.zst
ferdium-recipes-938961ca57a3d4d01b6bb7d15fedda66dec7def1.zip
Review Custom Website URL validation (#47)
Review Custom Website URL validation
-rw-r--r--all.json2
-rw-r--r--franz-custom-website.tar.gzbin2023 -> 5558 bytes
-rw-r--r--uncompressed/franz-custom-website/index.js7
-rw-r--r--uncompressed/franz-custom-website/package.json2
4 files changed, 4 insertions, 7 deletions
diff --git a/all.json b/all.json
index 4bb3cc5..4445d59 100644
--- a/all.json
+++ b/all.json
@@ -37,7 +37,7 @@
37 "featured": false, 37 "featured": false,
38 "id": "franz-custom-website", 38 "id": "franz-custom-website",
39 "name": "Custom Website", 39 "name": "Custom Website",
40 "version": "1.0.1", 40 "version": "1.0.2",
41 "icons": { 41 "icons": {
42 "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/franz-custom-website/icon.png", 42 "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/franz-custom-website/icon.png",
43 "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/franz-custom-website/icon.svg" 43 "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/franz-custom-website/icon.svg"
diff --git a/franz-custom-website.tar.gz b/franz-custom-website.tar.gz
index cbcb557..68153e2 100644
--- a/franz-custom-website.tar.gz
+++ b/franz-custom-website.tar.gz
Binary files differ
diff --git a/uncompressed/franz-custom-website/index.js b/uncompressed/franz-custom-website/index.js
index 47da782..62f4218 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 {
4 async validateUrl(url) { 4 async validateUrl(url) {
5 try { 5 try {
6 const resp = await window.fetch(url, { 6 const resp = await window.fetch(url, {
7 method: 'GET', 7 method: 'GET'
8 headers: {
9 'Content-Type': 'application/json'
10 }
11 }); 8 });
12 return resp.status.toString().startsWith('2') || resp.status.toString().startsWith('3'); 9 return !resp.status.toString().startsWith('4');
13 } catch (err) { 10 } catch (err) {
14 console.error(err); 11 console.error(err);
15 } 12 }
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 @@
1{ 1{
2 "id": "franz-custom-website", 2 "id": "franz-custom-website",
3 "name": "Custom Website", 3 "name": "Custom Website",
4 "version": "1.0.1", 4 "version": "1.0.2",
5 "description": "Add a custom website to Franz", 5 "description": "Add a custom website to Franz",
6 "main": "index.js", 6 "main": "index.js",
7 "author": "Stefan Malzner <stefan@adlk.io>", 7 "author": "Stefan Malzner <stefan@adlk.io>",