From 52a790805def063747238a7f2ad199a11e39c66a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Cie=C5=9Blak?= Date: Wed, 16 May 2018 00:46:38 +0200 Subject: [PATCH] Validate Misskey URL --- cli/init.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/init.js b/cli/init.js index 96160b0b8..5a3650957 100644 --- a/cli/init.js +++ b/cli/init.js @@ -18,7 +18,11 @@ const form = [{ }, { type: 'input', name: 'url', - message: 'URL you want to run Misskey:' + message: 'URL you want to run Misskey:', + validate: function(wannabeurl) { + return wannabeurl.match('^http\(s?\)://') ? true : + 'URL needs to start with http:// or https://'; + } }, { type: 'input', name: 'port',