diff options
author | 2020-02-22 02:56:03 +0100 | |
---|---|---|
committer | 2020-02-22 02:56:03 +0100 | |
commit | 59fd4afe27bfd0a329e6739e057d6921b8328d8a (patch) | |
tree | 67b5d238dfdb8575a43442f6edc75ae95a5523b7 /uncompressed/franz-custom-website/index.js | |
parent | Remove unneeded workflows (diff) | |
download | ferdium-recipes-59fd4afe27bfd0a329e6739e057d6921b8328d8a.tar.gz ferdium-recipes-59fd4afe27bfd0a329e6739e057d6921b8328d8a.tar.zst ferdium-recipes-59fd4afe27bfd0a329e6739e057d6921b8328d8a.zip |
Review Custom Website URL validation
Diffstat (limited to 'uncompressed/franz-custom-website/index.js')
-rw-r--r-- | uncompressed/franz-custom-website/index.js | 7 |
1 files changed, 2 insertions, 5 deletions
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 { | |||
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('2'); |
13 | } catch (err) { | 10 | } catch (err) { |
14 | console.error(err); | 11 | console.error(err); |
15 | } | 12 | } |