Page MenuHomePhabricator

[Cashtab] Better validation for token document url
ClosedPublic

Authored by bytesofman on Apr 17 2024, 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
Branch
better-url-validation
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28624
Build 56789: Build Diffcashtab-tests
Build 56788: arc lint + arc unit