-
Notifications
You must be signed in to change notification settings - Fork 64
🐛 (catalogd) serveJSON
lines instead of http.serverContent
for no-params
#1725
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
🐛 (catalogd) serveJSON
lines instead of http.serverContent
for no-params
#1725
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -244,7 +244,7 @@ func (s *LocalDirV1) handleV1Query(w http.ResponseWriter, r *http.Request) { | |||
if schema == "" && pkg == "" && name == "" { | |||
// If no parameters are provided, return the entire catalog (this is the same as /api/v1/all) | |||
w.Header().Add("Content-Type", "application/jsonl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this line, since serveJSONLines
does it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
serveJSON
lines instead of http.serverContent
for no-paramsserveJSON
lines instead of http.serverContent
for no-params
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1725 +/- ##
==========================================
+ Coverage 67.58% 67.61% +0.03%
==========================================
Files 59 59
Lines 4982 4981 -1
==========================================
+ Hits 3367 3368 +1
+ Misses 1371 1369 -2
Partials 244 244
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…arams 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]>
740d117
to
f88c3b8
Compare
/lgtm |
f6b1130
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 forserveJSONLines
to make sure metas endpoint is consistent in it's lack of support for range requests.Description
Reviewer Checklist