Skip to content

Commit f6b1130

Browse files
authored
(catalogd) serveJSON lines instead of http.serverContent for no-params (#1725)
The metas endpoint was using `serverJSONLines` for serving queries that are parameterized, which copies content from a reader to the response writer under the hood. As a result no-parameterized query responses don't have range request support. The endpoint was however using `http.ServeContent` for cases when no parameters were provided, which does have range request support. This PR switches the `http.ServeContent` out for `serveJSONLines` to make sure metas endpoint is consistent in it's lack of support for range requests. Signed-off-by: Anik Bhattacharjee <[email protected]>
1 parent 5965d5c commit f6b1130

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

catalogd/internal/storage/localdir.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ func (s *LocalDirV1) handleV1Metas(w http.ResponseWriter, r *http.Request) {
257257

258258
if schema == "" && pkg == "" && name == "" {
259259
// If no parameters are provided, return the entire catalog (this is the same as /api/v1/all)
260-
w.Header().Add("Content-Type", "application/jsonl")
261-
http.ServeContent(w, r, "", catalogStat.ModTime(), catalogFile)
260+
serveJSONLines(w, r, catalogFile)
262261
return
263262
}
264263
idx, err := s.getIndex(catalog)

0 commit comments

Comments
 (0)