From 5f8df0d5816a315085243e1dca45f506978c9a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B2=B3?= Date: Thu, 8 Nov 2018 23:09:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- http.go | 4 +++- json.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/http.go b/http.go index 4288b8a..0994700 100755 --- a/http.go +++ b/http.go @@ -69,7 +69,9 @@ func EncodeResponse(r *http.Response) ([]byte, error) { raw := bytes.NewBuffer([]byte{}) binary.Write(raw, binary.LittleEndian, []byte("sign")) respBytes, err := httputil.DumpResponse(r, true) - respBytes = replaceHost(respBytes) + if config.Replace == 1 { + respBytes = replaceHost(respBytes) + } if err != nil { return nil, err } diff --git a/json.go b/json.go index 10269b2..1717e77 100755 --- a/json.go +++ b/json.go @@ -23,6 +23,7 @@ type Site struct { type Config struct { Server Server SiteList []Site + Replace int } type JsonStruct struct { }