aboutsummaryrefslogtreecommitdiffstats
path: root/modules/httplib/url_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/httplib/url_test.go')
-rw-r--r--modules/httplib/url_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/httplib/url_test.go b/modules/httplib/url_test.go
index 9b7b242298..9bf09bcf2f 100644
--- a/modules/httplib/url_test.go
+++ b/modules/httplib/url_test.go
@@ -53,6 +53,8 @@ func TestIsCurrentGiteaSiteURL(t *testing.T) {
assert.True(t, IsCurrentGiteaSiteURL(s), "good = %q", s)
}
bad := []string{
+ ".",
+ "foo",
"/",
"//",
"\\\\",
@@ -67,5 +69,8 @@ func TestIsCurrentGiteaSiteURL(t *testing.T) {
setting.AppURL = "http://localhost:3000/"
setting.AppSubURL = ""
+ assert.False(t, IsCurrentGiteaSiteURL("//"))
+ assert.False(t, IsCurrentGiteaSiteURL("\\\\"))
+ assert.False(t, IsCurrentGiteaSiteURL("http://localhost"))
assert.True(t, IsCurrentGiteaSiteURL("http://localhost:3000?key=val"))
}