-
Notifications
You must be signed in to change notification settings - Fork 2
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
Strange Content-Range header for search results #240
Comments
Branch issue-240-Strange_Content-Range_header_for_search_results created! |
Fix Summary: The created Content-Range header has been fixed to satisfy RFC 7233, i.e., let not exceed lastIndex the total number of elements and return HTTP 416 (RangeNotSatisfyable) in case unsatisfyable range requests are submitted. A special case was the situation, when no results are returned. While RFC 7233 is focussed on byte array submission, which will probably return HTTP 404 if nothing was found, in our case also empty result sets can be returned such that no start and end index can be provided. For that case, a Content-Range header with the value */0 will be returned and has to be properly evaluated. |
Content-Range-Header can have a range-end that is larger than size.
According to RFC 7233 this is at least considered an error for byte-ranges:
This might not be the case for search-results but it looks like an error at first glance.
To Reproduce
Search for resources so that the number of results is not dividable by page-size. Now go to last page and examine Content-Range.
An alternative way ist to create a resource:
Search for it (replace ID with the id from the result of the previous step):
Now Content-Range will be 0-19/1, and range-end (19) is larger than size (1).
Expected behavior
range-end less than size, for example 0-0/1 for the previous example.
Version (output of actuator/info)
The text was updated successfully, but these errors were encountered: