coredns/plugin/pkg
Yong Tang c8844a8555
Replace io.LimitReader with http.MaxBytesReader (#5241)
Previously we use io.LimitReader to limit the number of bytes
from http request. However, there is a subtle difference between
io.LimitReader and io.ReadAll as io.LimitReader will return
a Reader, not a ReadCloser. As such the behavior will actually
be difference in case of error handling (and when to close).

This PR changes io.LimitReader to http.MaxBytesReader
so that the behavior can be preserved (except the number of bytes).
See https://stackoverflow.com/a/52699702

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2022-04-04 15:02:08 -04:00
..
cache Avoid copy of large value in range (#5243) 2022-03-18 10:13:58 -07:00
cidr auto go fmt 2021-06-07 10:43:28 +00:00
dnstest use pkg/reuseport in rest plugins (#3492) 2019-12-06 10:55:40 +00:00
dnsutil metrics: remove RR type (#4534) 2021-03-19 12:59:26 +01:00
doh Replace io.LimitReader with http.MaxBytesReader (#5241) 2022-04-04 15:02:08 -04:00
edns Make request.Request smaller (#3351) 2019-10-04 09:44:58 +01:00
fall deprecate Normalize and MustNormalize (#4648) 2021-05-27 13:26:14 +02:00
fuzz fuzz: revert setup function (#3189) 2019-08-25 19:01:35 +00:00
log cleanup deprecated package io/ioutil (#4920) 2021-10-13 09:30:31 +02:00
nonwriter Revert pkg/nonwriter changes (#1829) 2018-05-23 08:50:27 -04:00
parse Convert HostPortOrFile error to var (#5058) 2021-12-23 12:02:28 -05:00
rand Update to avoid pseudo-random number (#5225) 2022-03-16 12:24:58 -04:00
rcode doc: some function/vars/const/package level updates (#1558) 2018-02-23 15:02:05 +00:00
replacer do not log NOERROR in log plugin when response is not available (#4725) 2021-07-09 13:15:34 +02:00
response respond with REFUSED when max_concurrent is exceeded to avoid caching it (#4326) 2020-12-15 14:02:15 +01:00
reuseport update all +build statements (#5271) 2022-03-18 07:11:14 -07:00
singleflight Fix error string should not be capitalized (#2608) 2019-02-27 08:25:02 -05:00
tls Harden tls on all places (#5184) 2022-02-17 12:26:08 -08:00
trace Fix import ordering presubmit test (#4422) 2021-01-24 17:28:49 +00:00
transport Better naming (#2104) 2018-09-19 08:16:04 +01:00
uniq plugin/ready: fix starts and restarts (#2814) 2019-06-09 08:10:15 +01:00
up forward/up: HC every 0.5 seconds, do not do exponential backoff (#4371) 2021-01-12 13:55:01 +01:00
upstream Update upstream.Lookup method comment to reflect current state (#4832) 2021-08-27 14:23:05 +02:00