mirror of
https://github.com/labstack/echo.git
synced 2025-07-01 00:55:04 +02:00
Set maxParam with SetParamNames (#1535)
* Set maxParam with SetParamNames Fixes #1492 * Revert go.mod
This commit is contained in:
@ -93,7 +93,6 @@ func (responseWriterErr) WriteHeader(statusCode int) {
|
||||
|
||||
func TestContext(t *testing.T) {
|
||||
e := New()
|
||||
*e.maxParam = 1
|
||||
req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(userJSON))
|
||||
rec := httptest.NewRecorder()
|
||||
c := e.NewContext(req, rec).(*context)
|
||||
@ -472,7 +471,6 @@ func TestContextPath(t *testing.T) {
|
||||
|
||||
func TestContextPathParam(t *testing.T) {
|
||||
e := New()
|
||||
*e.maxParam = 2
|
||||
req := httptest.NewRequest(http.MethodGet, "/", nil)
|
||||
c := e.NewContext(req, nil)
|
||||
|
||||
@ -491,7 +489,8 @@ func TestContextPathParam(t *testing.T) {
|
||||
|
||||
func TestContextGetAndSetParam(t *testing.T) {
|
||||
e := New()
|
||||
*e.maxParam = 2
|
||||
r := e.Router()
|
||||
r.Add(http.MethodGet, "/:foo", func(Context) error { return nil })
|
||||
req := httptest.NewRequest(http.MethodGet, "/:foo", nil)
|
||||
c := e.NewContext(req, nil)
|
||||
c.SetParamNames("foo")
|
||||
|
Reference in New Issue
Block a user