Commit 4c6737a
authored
feat: Indicate range request support with Accept-Ranges header (#104)
## What I'm changing
This appends the
[`Accept-Ranges`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Ranges)
header to GET and HEAD responses for objects, indicating support for
HTTP range requests. Since some clients look for this header, it should
improve use of range requests.
Addresses
#103.
## How I did it
`get_object` and `head_object` responses now include `Accept-Ranges`, as
well as `Access-Control-Expose-Headers` for CORS safelisting.
## How to test it
When running the proxy:
* Perform a HEAD or GET request for an object
* Check the response headers; `Accept-Ranges: bytes` and
`Access-Control-Expose-Headers: Accept-Ranges` should both be present
## PR Checklist
- [x] This PR has **no** breaking changes.
- [ ] I have updated or added new tests to cover the changes in this PR.
- [ ] This PR affects the [Source Cooperative Frontend &
API](https://github.com/source-cooperative/source.coop),
and I have opened issue/PR #XXX to track the change.
## Related Issues
[[Proposed Feature] Indicate range request support with Accept-Ranges
header](#103)1 parent f072484 commit 4c6737a
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| |||
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
136 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
| |||
351 | 356 | | |
352 | 357 | | |
353 | 358 | | |
| 359 | + | |
| 360 | + | |
354 | 361 | | |
355 | 362 | | |
356 | 363 | | |
| |||
0 commit comments