Skip to content

handlers: fix panic in search, fix #300 #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions handlers/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,13 @@
cursor string
opts client.SearchObjectsOptions

searchHeader = filters[0].Header()
returningAttributes = make([]string, 0, len(searchFilters.Attributes)+1)
searchHeader string

Check warning on line 480 in handlers/objects.go

View check run for this annotation

Codecov / codecov/patch

handlers/objects.go#L479-L480

Added lines #L479 - L480 were not covered by tests
)
if len(filters) > 0 {
searchHeader = filters[0].Header()
returningAttributes = append(returningAttributes, searchHeader)
}

Check warning on line 485 in handlers/objects.go

View check run for this annotation

Codecov / codecov/patch

handlers/objects.go#L482-L485

Added lines #L482 - L485 were not covered by tests

for i, attr := range searchFilters.Attributes {
if attr == searchHeader {
Expand All @@ -486,7 +491,7 @@
}
}

returningAttributes := append([]string{searchHeader}, searchFilters.Attributes...)
returningAttributes = append(returningAttributes, searchFilters.Attributes...)

Check warning on line 494 in handlers/objects.go

View check run for this annotation

Codecov / codecov/patch

handlers/objects.go#L494

Added line #L494 was not covered by tests
if params.Cursor != nil {
cursor = *params.Cursor
}
Expand Down
Loading