diff options
author | valentin v / vvval <[email protected]> | 2019-02-21 15:17:40 +0300 |
---|---|---|
committer | valentin v / vvval <[email protected]> | 2019-02-21 15:17:40 +0300 |
commit | 46a52a8691e83c81a6d12183eddf188b5d15f011 (patch) | |
tree | 5aa06af7b90be39f72559eb8500c591d2bc411c9 /service/http/handler_test.go | |
parent | 3c1923606c7b5391678b7a760772c8e55f046025 (diff) |
Rename MaxRequest config param
Added MaxRequestSize param, previous one is marked as deprecated,
now they are merged
Diffstat (limited to 'service/http/handler_test.go')
-rw-r--r-- | service/http/handler_test.go | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/service/http/handler_test.go b/service/http/handler_test.go index aaf9760b..6df0a620 100644 --- a/service/http/handler_test.go +++ b/service/http/handler_test.go @@ -32,7 +32,7 @@ func get(url string) (string, *http.Response, error) { func TestHandler_Echo(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -67,7 +67,7 @@ func TestHandler_Echo(t *testing.T) { func Test_HandlerErrors(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -94,7 +94,7 @@ func Test_HandlerErrors(t *testing.T) { func Test_Handler_JSON_error(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -123,7 +123,7 @@ func Test_Handler_JSON_error(t *testing.T) { func TestHandler_Headers(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -170,7 +170,7 @@ func TestHandler_Headers(t *testing.T) { func TestHandler_Empty_User_Agent(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -216,7 +216,7 @@ func TestHandler_Empty_User_Agent(t *testing.T) { func TestHandler_User_Agent(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -262,7 +262,7 @@ func TestHandler_User_Agent(t *testing.T) { func TestHandler_Cookies(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -313,7 +313,7 @@ func TestHandler_Cookies(t *testing.T) { func TestHandler_JsonPayload_POST(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -363,7 +363,7 @@ func TestHandler_JsonPayload_POST(t *testing.T) { func TestHandler_JsonPayload_PUT(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -409,7 +409,7 @@ func TestHandler_JsonPayload_PUT(t *testing.T) { func TestHandler_JsonPayload_PATCH(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -455,7 +455,7 @@ func TestHandler_JsonPayload_PATCH(t *testing.T) { func TestHandler_FormData_POST(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -513,7 +513,7 @@ func TestHandler_FormData_POST(t *testing.T) { func TestHandler_FormData_POST_Form_UrlEncoded_Charset(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -571,7 +571,7 @@ func TestHandler_FormData_POST_Form_UrlEncoded_Charset(t *testing.T) { func TestHandler_FormData_PUT(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -629,7 +629,7 @@ func TestHandler_FormData_PUT(t *testing.T) { func TestHandler_FormData_PATCH(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -687,7 +687,7 @@ func TestHandler_FormData_PATCH(t *testing.T) { func TestHandler_Multipart_POST(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -749,7 +749,7 @@ func TestHandler_Multipart_POST(t *testing.T) { func TestHandler_Multipart_PUT(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -811,7 +811,7 @@ func TestHandler_Multipart_PUT(t *testing.T) { func TestHandler_Multipart_PATCH(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -873,7 +873,7 @@ func TestHandler_Multipart_PATCH(t *testing.T) { func TestHandler_Error(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -907,7 +907,7 @@ func TestHandler_Error(t *testing.T) { func TestHandler_Error2(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -941,7 +941,7 @@ func TestHandler_Error2(t *testing.T) { func TestHandler_Error3(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1, + MaxRequestSize: 1, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -986,7 +986,7 @@ func TestHandler_Error3(t *testing.T) { func TestHandler_ResponseDuration(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -1035,7 +1035,7 @@ func TestHandler_ResponseDuration(t *testing.T) { func TestHandler_ResponseDurationDelayed(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -1084,7 +1084,7 @@ func TestHandler_ResponseDurationDelayed(t *testing.T) { func TestHandler_ErrorDuration(t *testing.T) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, @@ -1132,7 +1132,7 @@ func TestHandler_ErrorDuration(t *testing.T) { func BenchmarkHandler_Listen_Echo(b *testing.B) { h := &Handler{ cfg: &Config{ - MaxRequest: 1024, + MaxRequestSize: 1024, Uploads: &UploadsConfig{ Dir: os.TempDir(), Forbid: []string{}, |