mirror of https://github.com/aredn/aredn.git
Fix suffix and bad protocol suffix service url name checks (#269)
This commit is contained in:
parent
6e198fa704
commit
b17f52c27d
|
@ -96,7 +96,7 @@ function validate_service_name(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
function validate_service_protocol(proto)
|
function validate_service_protocol(proto)
|
||||||
if not name or name == "" or name:match("[:-\"|]") or not name:match("^%w+") then
|
if not proto or proto == "" or proto:match("[:-\"|]") or not proto:match("^%w+") then
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
return true
|
return true
|
||||||
|
@ -104,7 +104,7 @@ function validate_service_protocol(proto)
|
||||||
end
|
end
|
||||||
|
|
||||||
function validate_service_suffix(suffix)
|
function validate_service_suffix(suffix)
|
||||||
if not suffix or suffix:match("[:-\"|]") or not name:match("^[%w/?._=#-]*$") then
|
if not suffix or suffix:match("[:-\"|]") or not suffix:match("^[%w/?._=#-]*$") then
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue