Pull request 2263: AGDNS-2280 Upd dnsproxy, golibs

Squashed commit of the following:

commit 8d83eebba851e8e09bb08b1c94a247cb049a1b75
Merge: c6574a33c b6ed76965
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Aug 5 16:59:50 2024 +0300

    Merge branch 'master' into AGDNS-2280-upd-golibs

commit c6574a33c6
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Jul 31 19:56:58 2024 +0300

    all: upd proxy, golibs
This commit is contained in:
Eugene Burkov 2024-08-05 17:12:33 +03:00
parent b6ed769652
commit edfa8c147f
11 changed files with 69 additions and 62 deletions
internal/home

View file

@ -14,29 +14,29 @@ import (
func TestLimitRequestBody(t *testing.T) {
errReqLimitReached := &ioutil.LimitError{
Limit: defaultReqBodySzLim,
Limit: defaultReqBodySzLim.Bytes(),
}
testCases := []struct {
wantErr error
name string
body string
want []byte
wantErr error
}{{
wantErr: nil,
name: "not_so_big",
body: "somestr",
want: []byte("somestr"),
wantErr: nil,
}, {
wantErr: errReqLimitReached,
name: "so_big",
body: string(make([]byte, defaultReqBodySzLim+1)),
want: make([]byte, defaultReqBodySzLim),
wantErr: errReqLimitReached,
}, {
wantErr: nil,
name: "empty",
body: "",
want: []byte(nil),
wantErr: nil,
}}
makeHandler := func(t *testing.T, err *error) http.HandlerFunc {