From 5d21c737b68cc238ac3f7f0195e70b3830244fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B0=E5=B8=88=E9=B9=8F?= Date: Fri, 29 Sep 2023 12:15:31 +0800 Subject: [PATCH] clean code --- replayer-agent/common/handlers/httpclient/init.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/replayer-agent/common/handlers/httpclient/init.go b/replayer-agent/common/handlers/httpclient/init.go index 8c9ff27..958d13f 100644 --- a/replayer-agent/common/handlers/httpclient/init.go +++ b/replayer-agent/common/handlers/httpclient/init.go @@ -26,7 +26,7 @@ func (hc *HttpClient) Get(ctx context.Context, url string) (*http.Response, []by tlog.Handler.Errorf(ctx, tlog.DLTagUndefined, err.Error()) return nil, nil, err } - req.SetBasicAuth("elastic", "ES_test_7") + req.SetBasicAuth("username", "password") req.Header.Set("Content-Type", "application/x-www-form-urlencoded;charset=utf-8") client := &http.Client{} @@ -49,7 +49,7 @@ func (hc *HttpClient) Post(ctx context.Context, url string, jsonBytes []byte, ti tlog.Handler.Errorf(ctx, tlog.DLTagUndefined, err.Error()) return nil, nil, err } - req.SetBasicAuth("elastic", "ES_test_7") + req.SetBasicAuth("username", "password") //默认 application/json req.Header.Set("Content-Type", "application/json;charset=utf-8") //headers 优先级更高