From e7ca491a94ddab6ecf0e2251f4f00ef6cb6c04b3 Mon Sep 17 00:00:00 2001 From: otuki <58715442+tttfrfr2@users.noreply.github.com> Date: Wed, 21 Apr 2021 10:00:58 +0900 Subject: [PATCH] fix(report): Avoid http reports error (#1216) --- reporter/http.go | 4 ++-- subcmds/report.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reporter/http.go b/reporter/http.go index 7f78e030..9b0d79d9 100644 --- a/reporter/http.go +++ b/reporter/http.go @@ -11,7 +11,7 @@ import ( // HTTPRequestWriter writes results to HTTP request type HTTPRequestWriter struct { - Proxy string + URL string } // Write sends results as HTTP response @@ -21,7 +21,7 @@ func (w HTTPRequestWriter) Write(rs ...models.ScanResult) (err error) { if err := json.NewEncoder(b).Encode(r); err != nil { return err } - _, err = http.Post(w.Proxy, "application/json; charset=utf-8", b) + _, err = http.Post(w.URL, "application/json; charset=utf-8", b) if err != nil { return err } diff --git a/subcmds/report.go b/subcmds/report.go index 3bcef449..6a67bda1 100644 --- a/subcmds/report.go +++ b/subcmds/report.go @@ -283,7 +283,7 @@ func (p *ReportCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{} } if p.toHTTP { - reports = append(reports, reporter.HTTPRequestWriter{Proxy: config.Conf.HTTPProxy}) + reports = append(reports, reporter.HTTPRequestWriter{URL: config.Conf.HTTP.URL}) } if p.toLocalFile {