@@ -179,7 +179,7 @@ func (a *API) blobSidecarHandler(w http.ResponseWriter, r *http.Request) {
179
179
180
180
blobSidecars := result .BlobSidecars
181
181
182
- filteredBlobSidecars , err := filterBlobs (blobSidecars .Data , r .URL .Query (). Get ( "indices" ) )
182
+ filteredBlobSidecars , err := filterBlobs (blobSidecars .Data , r .URL .Query ()[ "indices" ] )
183
183
if err != nil {
184
184
err .write (w )
185
185
return
@@ -217,18 +217,18 @@ func (a *API) blobSidecarHandler(w http.ResponseWriter, r *http.Request) {
217
217
218
218
// filterBlobs filters the blobs based on the indices query provided.
219
219
// If no indices are provided, all blobs are returned. If invalid indices are provided, an error is returned.
220
- func filterBlobs (blobs []* deneb.BlobSidecar , indices string ) ([]* deneb.BlobSidecar , * httpError ) {
221
- if indices == "" {
222
- return blobs , nil
223
- }
224
-
225
- splits := strings .Split (indices , "," )
226
- if len (splits ) == 0 {
220
+ func filterBlobs (blobs []* deneb.BlobSidecar , _indices []string ) ([]* deneb.BlobSidecar , * httpError ) {
221
+ var indices []string
222
+ if len (_indices ) == 0 {
227
223
return blobs , nil
224
+ } else if len (_indices ) == 1 {
225
+ indices = strings .Split (_indices [0 ], "," )
226
+ } else {
227
+ indices = _indices
228
228
}
229
229
230
230
indicesMap := map [deneb.BlobIndex ]struct {}{}
231
- for _ , index := range splits {
231
+ for _ , index := range indices {
232
232
parsedInt , err := strconv .ParseUint (index , 10 , 64 )
233
233
if err != nil {
234
234
return nil , newIndicesError (index )
0 commit comments