summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2018-07-09 13:32:42 -0400
committerCarlos Tadeu Panato Junior <ctadeu@gmail.com>2018-07-09 19:32:42 +0200
commit28449dd95ae2c550d49c021217518feeb582a5d9 (patch)
tree8aa1afc4d1078f5ed8a1463c160d5e941d961754
parent8a02121767e696dac0727a9a064d6d504bc34787 (diff)
downloadchat-28449dd95ae2c550d49c021217518feeb582a5d9.tar.gz
chat-28449dd95ae2c550d49c021217518feeb582a5d9.tar.bz2
chat-28449dd95ae2c550d49c021217518feeb582a5d9.zip
Update custom url schemes error message to reflect what we actually support (#9061)
-rw-r--r--i18n/en.json2
-rw-r--r--model/config.go2
-rw-r--r--model/config_test.go4
3 files changed, 4 insertions, 4 deletions
diff --git a/i18n/en.json b/i18n/en.json
index 730fc2b63..d8a059175 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -3784,7 +3784,7 @@
},
{
"id": "model.config.is_valid.display.custom_url_schemes.app_error",
- "translation": "The custom URL scheme {{.Scheme}} is invalid. Custom URL schemes must start with a letter and contain only letters, numbers, plus (+), period (.), and hyphen (-)."
+ "translation": "The custom URL scheme {{.Scheme}} is invalid. Custom URL schemes must start with a letter and contain only letters, numbers and hyphen (-)."
},
{
"id": "model.config.is_valid.elastic_search.aggregate_posts_after_days.app_error",
diff --git a/model/config.go b/model/config.go
index 7105af893..be940d893 100644
--- a/model/config.go
+++ b/model/config.go
@@ -2418,7 +2418,7 @@ func (mes *MessageExportSettings) isValid(fs FileSettings) *AppError {
func (ds *DisplaySettings) isValid() *AppError {
if len(*ds.CustomUrlSchemes) != 0 {
- validProtocolPattern := regexp.MustCompile(`(?i)^\s*[a-z][a-z0-9+.-]*\s*$`)
+ validProtocolPattern := regexp.MustCompile(`(?i)^\s*[a-z][a-z0-9-]*\s*$`)
for _, scheme := range *ds.CustomUrlSchemes {
if !validProtocolPattern.MatchString(scheme) {
diff --git a/model/config_test.go b/model/config_test.go
index 5406d680d..848f4327e 100644
--- a/model/config_test.go
+++ b/model/config_test.go
@@ -466,7 +466,7 @@ func TestDisplaySettingsIsValidCustomUrlSchemes(t *testing.T) {
{
name: "containing period",
value: []string{"iris.beep"},
- valid: true,
+ valid: false, // should technically be true, but client doesn't support it
},
{
name: "containing hyphen",
@@ -476,7 +476,7 @@ func TestDisplaySettingsIsValidCustomUrlSchemes(t *testing.T) {
{
name: "containing plus",
value: []string{"coap+tcp", "coap+ws"},
- valid: true,
+ valid: false, // should technically be true, but client doesn't support it
},
{
name: "starting with number",