`Accept-Ranges` should not be returned when output caching is used
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
When output caching is used with static content, the `Accept-Ranges` header is returned, but requests with the `Ranges` header are not served correctly.
### Expected Behavior
The `Accept-Ranges` header should not be set when output caching is enabled. The `Ranges` header in requests should be ignored when output caching is enabled.
### Steps To Reproduce
This project has a simple repro:
https://github.com/jonpayne/AspNetCacheIssue/tree/main/src
Using this example:
```bash
curl -s -D - https://localhost:5000/test.txt -H "Range: bytes=0-32" // returns a range
curl -s -D - https://localhost:5000/test.txt -H "Range: bytes=0-40" // returns a different range
curl -s -D - https://localhost:5000/test.txt // returns the full content
curl -s -D - https://localhost:5000/test.txt -H "Range: bytes=0-32" // returns the full content (unexpected)
curl -s -D - https://localhost:5000/test.txt -H "Range: bytes=0-40" // returns the full content (unexpected)
```
### Exceptions (if any)
_No response_
### .NET Version
7.0.101
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.