Pull request #1005: home: imp large req handling

Merge in DNS/adguard-home from 2675-larger-requests to master

Updates #2675.

Squashed commit of the following:

commit 2b45c9bfdc817980204b11de768b425fb72a6488
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Feb 15 13:38:44 2021 +0300

    home: imp names

commit dad39ae7ee35346ea91f15665acc93ba0b5653df
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Feb 15 13:31:53 2021 +0300

    home: imp large req handling
This commit is contained in:
Ainar Garipov
2021-02-15 13:56:41 +03:00
parent 8a0bc5468b
commit 7d1ca48ae4
3 changed files with 34 additions and 15 deletions

View File

@@ -14,7 +14,7 @@ import (
func TestLimitRequestBody(t *testing.T) {
errReqLimitReached := &aghio.LimitReachedError{
Limit: RequestBodySizeLimit,
Limit: defaultReqBodySzLim,
}
testCases := []struct {
@@ -29,8 +29,8 @@ func TestLimitRequestBody(t *testing.T) {
wantErr: nil,
}, {
name: "so_big",
body: string(make([]byte, RequestBodySizeLimit+1)),
want: make([]byte, RequestBodySizeLimit),
body: string(make([]byte, defaultReqBodySzLim+1)),
want: make([]byte, defaultReqBodySzLim),
wantErr: errReqLimitReached,
}, {
name: "empty",