Skip to content
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

Add support for Range header in object GET requests #241

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Conversation

tatiana-nspcc
Copy link
Contributor

The Range header is now accepted for /objects/{cid}/by_id/{oid} and /objects/{cid}/by_attribute/{oid} requests.

Close #224.

Added function `formAllowRecord` to create `apiserver.Record`.

Signed-off-by: Tatiana Nesterenko <tatiana@nspcc.io>
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 36.96970% with 104 lines in your changes missing coverage. Please review.

Project coverage is 22.79%. Comparing base (2da2ee6) to head (76145eb).
Report is 7 commits behind head on master.

Files Patch % Lines
handlers/newObjects.go 25.43% 83 Missing and 2 partials ⚠️
handlers/apiserver/rest-server.gen.go 27.77% 11 Missing and 2 partials ⚠️
handlers/rangeReader.go 87.09% 2 Missing and 2 partials ⚠️
handlers/objects.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #241      +/-   ##
==========================================
+ Coverage   22.12%   22.79%   +0.66%     
==========================================
  Files          17       18       +1     
  Lines        3507     3672     +165     
==========================================
+ Hits          776      837      +61     
- Misses       2579     2677      +98     
- Partials      152      158       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add Accept-Ranges

The `Range` header is now accepted for `/objects/{cid}/by_id/{oid}` and
`/objects/{cid}/by_attribute/{oid}` requests.

Close #224.

Signed-off-by: Tatiana Nesterenko <tatiana@nspcc.io>
Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accept-Ranges?

Add the `Accept-Ranges` header into the API responses for
`/objects/{cid}/by_id/{oid}` and `/objects/{cid}/by_attribute/{oid}`.
`bytes` is the only accepted range unit.

Signed-off-by: Tatiana Nesterenko <tatiana@nspcc.io>
@tatiana-nspcc
Copy link
Contributor Author

Accept-Ranges?

Sorry, added.

@roman-khimov roman-khimov merged commit af413ee into master Aug 27, 2024
14 checks passed
@roman-khimov roman-khimov deleted the 224-range branch August 27, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Range header support
3 participants