Fix/cookie host (#76)

* fix: cookie host

* feat: add test for url utils

* fix: url test

* fix: multi domain cookie if allowed
This commit is contained in:
Lakhan Samani
2021-12-11 06:41:35 +05:30
committed by GitHub
parent 74a551ae09
commit 00565c8717
5 changed files with 41 additions and 4 deletions

25
server/utils/urls_test.go Normal file
View File

@@ -0,0 +1,25 @@
package utils
import "testing"
func TestGetHostName(t *testing.T) {
authorizer_url := "http://test.herokuapp.com"
got := GetHostName(authorizer_url)
want := "test.herokuapp.com"
if got != want {
t.Errorf("GetHostName Test failed got %s, wanted %s", got, want)
}
}
func TestGetDomainName(t *testing.T) {
authorizer_url := "http://test.herokuapp.com"
got := GetDomainName(authorizer_url)
want := "herokuapp.com"
if got != want {
t.Errorf("GetHostName Test failed got %q, wanted %q", got, want)
}
}