From 9e9182bd54b25358505cc16a06585b8426644f81 Mon Sep 17 00:00:00 2001 From: Yangjing Zhang Date: Fri, 13 Dec 2024 13:54:15 +0800 Subject: [PATCH 1/3] Fix 'nil pointer dereference' --- headers_inspection_handler.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headers_inspection_handler.go b/headers_inspection_handler.go index 34ddb19..d02033e 100644 --- a/headers_inspection_handler.go +++ b/headers_inspection_handler.go @@ -104,6 +104,9 @@ func (middleware HeadersInspectionHandler) Intercept(pipeline Pipeline, middlewa } } response, err := pipeline.Next(req, middlewareIndex) + if err != nil { + return response, err + } if reqOption.GetInspectResponseHeaders() { for k, v := range response.Header { if len(v) == 1 { @@ -113,8 +116,5 @@ func (middleware HeadersInspectionHandler) Intercept(pipeline Pipeline, middlewa } } } - if err != nil { - return response, err - } return response, err } From bea82e739851bd9ca84fc21cb7224361779c0f77 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 13 Dec 2024 07:40:04 -0500 Subject: [PATCH 2/3] chore: bumps patch version --- CHANGELOG.md | 7 +++++++ user_agent_handler.go | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 165ff1f..6f4803a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.4.6] - 2024-12-13 + +### Changed + +- Fixed a bug where headers inspection handler would fail upon receiving an error. + ## [1.4.5] - 2024-09-03 ### Changed + - Fixed a bug in compression middleware which caused empty body to send on retries ## [1.4.4] - 2024-08-13 diff --git a/user_agent_handler.go b/user_agent_handler.go index 3f94bf2..51af61b 100644 --- a/user_agent_handler.go +++ b/user_agent_handler.go @@ -42,7 +42,7 @@ func NewUserAgentHandlerOptions() *UserAgentHandlerOptions { return &UserAgentHandlerOptions{ Enabled: true, ProductName: "kiota-go", - ProductVersion: "1.4.5", + ProductVersion: "1.4.6", } } From ac57f8569f14a81362583192a4dde32aef42732d Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 13 Dec 2024 07:41:49 -0500 Subject: [PATCH 3/3] chore: adds workflow dispatch to codeql workflow --- .github/workflows/codeql-analysis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index bd64251..c64250b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,6 +19,7 @@ on: branches: [ main ] schedule: - cron: '40 16 * * 3' + workflow_dispatch: jobs: analyze: