aboutsummaryrefslogtreecommitdiff
path: root/plugin/pkg/doh/doh.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-03-03DoH: Allow http as the protocol (#5762)Gravatar Sebastian Dahlgren 1-3/+20
This change avoids the hard coding of HTTPS, allowing flexibility in whether HTTP or HTTPS is used. Signed-off-by: Sebastian Dahlgren <sebdah@fb.com>
2022-04-04Replace io.LimitReader with http.MaxBytesReader (#5241)Gravatar Yong Tang 1-1/+1
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-03-04Add limit to ioutil.ReadAll for request body (#5224)Gravatar Yong Tang 1-1/+1
This PR adds limit to ioutil.ReadAll for DoH request body so that it will not be subject to large requests. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2021-10-13cleanup deprecated package io/ioutil (#4920)Gravatar Zou Nengren 1-2/+1
Signed-off-by: zounengren <zouyee1989@gmail.com>
2020-11-11Remove newlines between braces (#4279)Gravatar Miek Gieben 1-2/+0
These are found with: `pcregrep -M "}\n\n}" **/*.go` Sometimes a unneeded newline is inserted, remove those. Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-14Typo fixes (#2031)Gravatar Karsten Weiss 1-1/+1
2018-07-07Doh: put in pkg/doh (#1946)Gravatar Miek Gieben 1-0/+119
* DoH: put in pkg/doh Factor out the DoH stuff into its own package, add function to request a DoH response. This can be used by forward (and maybe proxy) to implement DoH client support. Signed-off-by: Miek Gieben <miek@miek.nl> * lint Signed-off-by: Miek Gieben <miek@miek.nl> * ... and make it compile Signed-off-by: Miek Gieben <miek@miek.nl>