Этот коммит содержится в:
коммит произвёл
Hanzei
родитель
2d97f01781
Коммит
c05cf5b033
@@ -2871,7 +2871,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-Za-z][A-Za-z0-9.+-]*\s*$`)
|
||||||
|
|
||||||
for _, scheme := range ds.CustomUrlSchemes {
|
for _, scheme := range ds.CustomUrlSchemes {
|
||||||
if !validProtocolPattern.MatchString(scheme) {
|
if !validProtocolPattern.MatchString(scheme) {
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ func TestDisplaySettingsIsValidCustomUrlSchemes(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "containing period",
|
name: "containing period",
|
||||||
value: []string{"iris.beep"},
|
value: []string{"iris.beep"},
|
||||||
valid: false, // should technically be true, but client doesn't support it
|
valid: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "containing hyphen",
|
name: "containing hyphen",
|
||||||
@@ -519,7 +519,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: false, // should technically be true, but client doesn't support it
|
valid: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "starting with number",
|
name: "starting with number",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user