server: fill ctx.Query correctly (#73)

This commit is contained in:
aler9
2021-09-23 08:53:10 +02:00
parent dbfc058f0c
commit 84837b9751
7 changed files with 89 additions and 83 deletions

30
pkg/base/path_test.go Normal file
View File

@@ -0,0 +1,30 @@
package base
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestPathSplitQuery(t *testing.T) {
for _, ca := range []struct {
a string
b string
c string
}{
{
"test?a=b",
"test",
"a=b",
},
{
"test",
"test",
"",
},
} {
b, c := PathSplitQuery(ca.a)
require.Equal(t, ca.b, b)
require.Equal(t, ca.c, c)
}
}