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

15
pkg/base/path.go Normal file
View File

@@ -0,0 +1,15 @@
package base
import (
"strings"
)
// PathSplitQuery splits a path from a query.
func PathSplitQuery(pathAndQuery string) (string, string) {
i := strings.Index(pathAndQuery, "?")
if i >= 0 {
return pathAndQuery[:i], pathAndQuery[i+1:]
}
return pathAndQuery, ""
}