working commit
This commit is contained in:
@@ -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
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user