mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-03-30 05:19:56 +00:00
Merge pull request #61 from m13253/feature/no_ecs_arg
Allow client opt-out of EDNS0 Client Subnet
This commit is contained in:
@@ -234,6 +234,11 @@ func (s *Server) handlerFunc(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (s *Server) findClientIP(r *http.Request) net.IP {
|
||||
noEcs := r.URL.Query().Get("no_ecs")
|
||||
if strings.ToLower(noEcs) == "true" {
|
||||
return nil
|
||||
}
|
||||
|
||||
XForwardedFor := r.Header.Get("X-Forwarded-For")
|
||||
if XForwardedFor != "" {
|
||||
for _, addr := range strings.Split(XForwardedFor, ",") {
|
||||
|
||||
Reference in New Issue
Block a user