From 8c87248c06a0d5dfe401aea244081ded4ccde300 Mon Sep 17 00:00:00 2001 From: jweny Date: Wed, 15 Sep 2021 17:03:54 +0800 Subject: [PATCH] [fix bug] delete xff and xri --- internal/reverse/director.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/reverse/director.go b/internal/reverse/director.go index b1e52df..62e9d06 100644 --- a/internal/reverse/director.go +++ b/internal/reverse/director.go @@ -51,6 +51,10 @@ func (reverse *Reverse) Director(host string) func(request *http.Request) { request.Header.Del("Accept-Encoding") request.Header.Del("Content-Encoding") + // 删除默认代理头 + request.Header["X-Forwarded-For"] = nil + request.Header.Del("X-Real-Ip") + // 插件系统 rule 处理请求数据 if rules, ok := plugin.Plugins[host]; ok { for _, rule := range rules.Rule {