I've added checks to the helper function isDSNPUserUri() to check if the initial dsnp:// is the correct protocol as well as a check to make sure the id is a valid id consisting of only numbers with length of 1-20 and with no leading 0's
In convertToDSNPUserID, I've added checks on the given value if it was a string. If it is a string, I check to see if it is a string of all numbers which would be an id as well as checking for a hex string
Change summary:
Added checks to isDSNPUserUri to validate given value
Added checks to convertToDSNPUserID to check if its an id or hex string before checking for complete uri
…n given invalid values
Problem
https://www.pivotaltracker.com/n/projects/2436354/stories/179470225
Solution
I've added checks to the helper function isDSNPUserUri() to check if the initial
dsnp://
is the correct protocol as well as a check to make sure the id is a valid id consisting of only numbers with length of 1-20 and with no leading 0'sIn
convertToDSNPUserID
, I've added checks on the given value if it was a string. If it is a string, I check to see if it is a string of all numbers which would be an id as well as checking for a hex stringChange summary:
isDSNPUserUri
to validate given valueconvertToDSNPUserID
to check if its an id or hex string before checking for complete uri