Page MenuHomePhabricator

[Cashtab] Better validation for token document url
ClosedPublic

Authored by bytesofman on Wed, Apr 17, 16:54.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABCe8596237e083: [Cashtab] Better validation for token document url
Summary

T3528

Improve validation for token document url

  • We do not need to build the regex every time this function is run, define this as a const outside the function
  • Return distinct error msgs depending on the validation problem
  • We also update the newTokenDefaultUrl, since always utf8-encoding bytes for https:// is not necessary and this passes the validation
Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable