Skip to content

Commit

Permalink
Fix 'nil pointer dereference'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyangjing authored Dec 13, 2024
1 parent 5beb0cf commit 9e9182b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions headers_inspection_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -113,8 +116,5 @@ func (middleware HeadersInspectionHandler) Intercept(pipeline Pipeline, middlewa
}
}
}
if err != nil {
return response, err
}
return response, err
}

0 comments on commit 9e9182b

Please sign in to comment.