mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-03-30 16:25:39 +00:00
add no_ecs argument in query string support
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