mirror of
https://github.com/soypat/lneto.git
synced 2026-08-17 21:24:04 +00:00
Mux.MaxPathValues and other improvements
This commit is contained in:
@@ -196,8 +196,10 @@ func TestRouterRequestVisibleToHandler(t *testing.T) {
|
||||
router Router
|
||||
)
|
||||
var gotMethod, gotURI, gotHost string
|
||||
var gotMethodEnum Method
|
||||
sm.Handle("GET /index.html", func(ex *Exchange) {
|
||||
gotMethod = string(ex.RequestMethod())
|
||||
gotMethod = string(ex.RequestMethodRaw())
|
||||
gotMethodEnum = ex.RequestMethod()
|
||||
gotURI = string(ex.RequestTarget())
|
||||
gotHost = string(ex.RequestHeader("Host"))
|
||||
ex.WriteHeader(200)
|
||||
@@ -213,6 +215,9 @@ func TestRouterRequestVisibleToHandler(t *testing.T) {
|
||||
if gotMethod != "GET" {
|
||||
t.Errorf("want method %q, got %q", "GET", gotMethod)
|
||||
}
|
||||
if gotMethodEnum != MethGet {
|
||||
t.Errorf("want method enum %q, got %q", MethGet, gotMethodEnum)
|
||||
}
|
||||
if gotURI != "/index.html" {
|
||||
t.Errorf("want URI %q, got %q", "/index.html", gotURI)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user