@@ -179,7 +179,7 @@ func (a *API) blobSidecarHandler(w http.ResponseWriter, r *http.Request) {
179179
180180 blobSidecars := result .BlobSidecars
181181
182- filteredBlobSidecars , err := filterBlobs (blobSidecars .Data , r .URL .Query (). Get ( "indices" ) )
182+ filteredBlobSidecars , err := filterBlobs (blobSidecars .Data , r .URL .Query ()[ "indices" ] )
183183 if err != nil {
184184 err .write (w )
185185 return
@@ -217,18 +217,18 @@ func (a *API) blobSidecarHandler(w http.ResponseWriter, r *http.Request) {
217217
218218// filterBlobs filters the blobs based on the indices query provided.
219219// 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 {
227223 return blobs , nil
224+ } else if len (_indices ) == 1 {
225+ indices = strings .Split (_indices [0 ], "," )
226+ } else {
227+ indices = _indices
228228 }
229229
230230 indicesMap := map [deneb.BlobIndex ]struct {}{}
231- for _ , index := range splits {
231+ for _ , index := range indices {
232232 parsedInt , err := strconv .ParseUint (index , 10 , 64 )
233233 if err != nil {
234234 return nil , newIndicesError (index )
0 commit comments