internal/httpd/flash_test.go

4a511e42574ead9c92dc73fd320f296cc4dbea07
gitbay/internal/httpd/flash_test.go

19 lines · 412 bytes

1 symbol in this file
 1package httpd
 2
 3import "testing"
 4
 5func TestLocalPath(t *testing.T) {
 6	for p, want := range map[string]bool{
 7		"/settings":       true,
 8		"/a/b?c=d":        true,
 9		"":                false,
10		"settings":        false,
11		"//evil.example":  false,
12		`/\evil.example`:  false,
13		"https://x.test/": false,
14	} {
15		if got := localPath(p); got != want {
16			t.Errorf("localPath(%q) = %v, want %v", p, got, want)
17		}
18	}
19}
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form