* Fix command url validation

* Add Host and Scheme check in IsValidHttpUrl func

* Add unit tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Shota Gvinepadze
2020-09-28 17:59:04 +04:00
коммит произвёл GitHub
родитель 32fc41d807
Коммит f73157dd8f
3 изменённых файлов: 94 добавлений и 1 удалений

Просмотреть файл

@@ -86,6 +86,9 @@ func TestCommandIsValid(t *testing.T) {
o.URL = "1234"
require.NotNil(t, o.IsValid(), "should be invalid")
o.URL = "https:////example.com"
require.NotNil(t, o.IsValid(), "should be invalid")
o.URL = "https://example.com"
require.Nil(t, o.IsValid())