From 364e78bffd8f81a30dbb23b1635e345c9e38009e Mon Sep 17 00:00:00 2001 From: Jeremy Klein Date: Fri, 20 Sep 2024 18:08:32 -0700 Subject: [PATCH] Add a test --- uma/test/uma_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/uma/test/uma_test.go b/uma/test/uma_test.go index ff9b39f..f42e4e8 100644 --- a/uma/test/uma_test.go +++ b/uma/test/uma_test.go @@ -44,6 +44,13 @@ func TestParse(t *testing.T) { assert.ObjectsAreEqual(expectedQuery, *query) } +func TestInvalidUserName(t *testing.T) { + urlString := "https://vasp2.com/.well-known/lnurlp/bob<>%20?signature=signature&nonce=12345&vaspDomain=vasp1.com&umaVersion=1.0&isSubjectToTravelRule=true×tamp=12345678" + urlObj, _ := url.Parse(urlString) + _, err := uma.ParseLnurlpRequest(*urlObj) + require.Error(t, err) +} + func TestIsUmaQueryValid(t *testing.T) { urlString := "https://vasp2.com/.well-known/lnurlp/bob?signature=signature&nonce=12345&vaspDomain=vasp1.com&umaVersion=1.0&isSubjectToTravelRule=true×tamp=12345678" urlObj, _ := url.Parse(urlString)