From 34e24f42424a7f12518bba5e8b5016d4507d5e39 Mon Sep 17 00:00:00 2001 From: Matt Yang Date: Tue, 2 Apr 2024 14:42:05 -0400 Subject: [PATCH 1/2] do not read res if http errors --- core/services/ocr2/plugins/ccip/tokendata/http/http_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go b/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go index 2ab00e4384..79ec21b1b8 100644 --- a/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go +++ b/core/services/ocr2/plugins/ccip/tokendata/http/http_client.go @@ -34,7 +34,7 @@ func (s *HttpClient) Get(ctx context.Context, url string, timeout time.Duration) return nil, http.StatusRequestTimeout, nil, tokendata.ErrTimeout } // On error, res is nil in most cases, do not read res.StatusCode, return BadRequest - return nil, http.StatusBadRequest, res.Header, err + return nil, http.StatusBadRequest, nil, err } defer res.Body.Close() From 2531bbcb1b353a9af5b10aae876d1320b0c93ce1 Mon Sep 17 00:00:00 2001 From: Matt Yang Date: Tue, 2 Apr 2024 14:44:19 -0400 Subject: [PATCH 2/2] changeset --- .changeset/light-suns-build.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/light-suns-build.md diff --git a/.changeset/light-suns-build.md b/.changeset/light-suns-build.md new file mode 100644 index 0000000000..4adbc370fc --- /dev/null +++ b/.changeset/light-suns-build.md @@ -0,0 +1,5 @@ +--- +"ccip": patch +--- + +Do not read res if http errors