Skip to content

Commit

Permalink
enhance: Prevent generate "null" search params (#37812)
Browse files Browse the repository at this point in the history
Preventing generating null search params in restful search request

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Nov 19, 2024
1 parent b3fc530 commit 83c9029
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/distributed/proxy/httpserver/handler_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,9 @@ func generatePlaceholderGroup(ctx context.Context, body string, collSchema *sche

func generateSearchParams(ctx context.Context, c *gin.Context, reqSearchParams searchParams) []*commonpb.KeyValuePair {
var searchParams []*commonpb.KeyValuePair
if reqSearchParams.Params == nil {
reqSearchParams.Params = make(map[string]any)
}
bs, _ := json.Marshal(reqSearchParams.Params)
searchParams = append(searchParams, &commonpb.KeyValuePair{Key: Params, Value: string(bs)})
searchParams = append(searchParams, &commonpb.KeyValuePair{Key: common.IgnoreGrowing, Value: strconv.FormatBool(reqSearchParams.IgnoreGrowing)})
Expand Down

0 comments on commit 83c9029

Please sign in to comment.