Update custom url schemes error message to reflect what we actually support (#9061)
Этот коммит содержится в:
коммит произвёл
Carlos Tadeu Panato Junior
родитель
8a02121767
Коммит
28449dd95a
@@ -3784,7 +3784,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "model.config.is_valid.display.custom_url_schemes.app_error",
|
"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",
|
"id": "model.config.is_valid.elastic_search.aggregate_posts_after_days.app_error",
|
||||||
|
|||||||
@@ -2418,7 +2418,7 @@ func (mes *MessageExportSettings) isValid(fs FileSettings) *AppError {
|
|||||||
|
|
||||||
func (ds *DisplaySettings) isValid() *AppError {
|
func (ds *DisplaySettings) isValid() *AppError {
|
||||||
if len(*ds.CustomUrlSchemes) != 0 {
|
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 {
|
for _, scheme := range *ds.CustomUrlSchemes {
|
||||||
if !validProtocolPattern.MatchString(scheme) {
|
if !validProtocolPattern.MatchString(scheme) {
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ func TestDisplaySettingsIsValidCustomUrlSchemes(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "containing period",
|
name: "containing period",
|
||||||
value: []string{"iris.beep"},
|
value: []string{"iris.beep"},
|
||||||
valid: true,
|
valid: false, // should technically be true, but client doesn't support it
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "containing hyphen",
|
name: "containing hyphen",
|
||||||
@@ -476,7 +476,7 @@ func TestDisplaySettingsIsValidCustomUrlSchemes(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "containing plus",
|
name: "containing plus",
|
||||||
value: []string{"coap+tcp", "coap+ws"},
|
value: []string{"coap+tcp", "coap+ws"},
|
||||||
valid: true,
|
valid: false, // should technically be true, but client doesn't support it
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "starting with number",
|
name: "starting with number",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user