working commit

This commit is contained in:
2026-05-29 13:34:07 +02:00
parent bcdd2766e6
commit 4e2c548e97
15 changed files with 188 additions and 91 deletions
+4
View File
@@ -68,6 +68,10 @@ func (rctx *Context) GetQuery(key string) string {
return rctx.Request.URL.Query().Get(key)
}
func (rctx *Context) GetHost() string {
return rctx.Request.Host
}
func (rctx *Context) GetHeader(key string) string {
return rctx.Request.Header.Get(key)
}
+1 -1
View File
@@ -15,7 +15,7 @@ const (
startRegex byte = '{'
stopRegex byte = '}'
defaultRegexp = `[a-zA-Z0-9_\.]+`
defaultRegexp = `[a-zA-Z0-9_\.:]+`
)
func pathCompiler(path string) (string, error) {
+3
View File
@@ -158,6 +158,9 @@ func (route Route) Match(req *http.Request) bool {
if req.Method != route.Method {
return false
}
if req.Method == http.MethodConnect {
return true
}
match := route.Regexp.MatchString(req.URL.Path)
if match {
return true