mirror of
https://github.com/labstack/echo.git
synced 2025-07-17 01:43:02 +02:00
Replace http constants with stdlib ones, i.e.: http.MethodGet instead of echo.GET (#1205)
This commit is contained in:
@ -14,7 +14,7 @@ import (
|
||||
func TestBodyLimit(t *testing.T) {
|
||||
e := echo.New()
|
||||
hw := []byte("Hello, World!")
|
||||
req := httptest.NewRequest(echo.POST, "/", bytes.NewReader(hw))
|
||||
req := httptest.NewRequest(http.MethodPost, "/", bytes.NewReader(hw))
|
||||
rec := httptest.NewRecorder()
|
||||
c := e.NewContext(req, rec)
|
||||
h := func(c echo.Context) error {
|
||||
@ -38,7 +38,7 @@ func TestBodyLimit(t *testing.T) {
|
||||
assert.Equal(http.StatusRequestEntityTooLarge, he.Code)
|
||||
|
||||
// Based on content read (within limit)
|
||||
req = httptest.NewRequest(echo.POST, "/", bytes.NewReader(hw))
|
||||
req = httptest.NewRequest(http.MethodPost, "/", bytes.NewReader(hw))
|
||||
rec = httptest.NewRecorder()
|
||||
c = e.NewContext(req, rec)
|
||||
if assert.NoError(BodyLimit("2M")(h)(c)) {
|
||||
@ -47,7 +47,7 @@ func TestBodyLimit(t *testing.T) {
|
||||
}
|
||||
|
||||
// Based on content read (overlimit)
|
||||
req = httptest.NewRequest(echo.POST, "/", bytes.NewReader(hw))
|
||||
req = httptest.NewRequest(http.MethodPost, "/", bytes.NewReader(hw))
|
||||
rec = httptest.NewRecorder()
|
||||
c = e.NewContext(req, rec)
|
||||
he = BodyLimit("2B")(h)(c).(*echo.HTTPError)
|
||||
@ -57,7 +57,7 @@ func TestBodyLimit(t *testing.T) {
|
||||
func TestBodyLimitReader(t *testing.T) {
|
||||
hw := []byte("Hello, World!")
|
||||
e := echo.New()
|
||||
req := httptest.NewRequest(echo.POST, "/", bytes.NewReader(hw))
|
||||
req := httptest.NewRequest(http.MethodPost, "/", bytes.NewReader(hw))
|
||||
rec := httptest.NewRecorder()
|
||||
|
||||
config := BodyLimitConfig{
|
||||
|
Reference in New Issue
Block a user