Skip to content

Commit 6f5a7ee

Browse files
committed
Add section on Range requests to reference
Closes gh-35052
1 parent 4bf048c commit 6f5a7ee

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

framework-docs/modules/ROOT/nav.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
*** xref:web/webmvc-functional.adoc[]
198198
*** xref:web/webmvc/mvc-uri-building.adoc[]
199199
*** xref:web/webmvc/mvc-ann-async.adoc[]
200+
*** xref:web/webmvc/mvc-range.adoc[]
200201
*** xref:web/webmvc-cors.adoc[]
201202
*** xref:web/webmvc-versioning.adoc[]
202203
*** xref:web/webmvc/mvc-ann-rest-exceptions.adoc[]
@@ -294,6 +295,7 @@
294295
**** xref:web/webflux/controller/ann-advice.adoc[]
295296
*** xref:web/webflux-functional.adoc[]
296297
*** xref:web/webflux/uri-building.adoc[]
298+
*** xref:web/webflux/range.adoc[]
297299
*** xref:web/webflux-cors.adoc[]
298300
*** xref:web/webflux-versioning.adoc[]
299301
*** xref:web/webflux/ann-rest-exceptions.adoc[]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[[webflux-range]]
2+
= Range Requests
3+
:page-section-summary-toc: 1
4+
5+
[.small]#xref:web/webmvc/mvc-range.adoc[See equivalent in the Servlet stack]#
6+
7+
Spring WebFlux supports https://datatracker.ietf.org/doc/html/rfc9110#section-14[RFC 9110]
8+
range requests. For an overview, see the
9+
https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Range_requests[Ranger Requests]
10+
Mozilla guide.
11+
12+
The `Range` header is parsed and handled transparently in WebFlux when an annotated
13+
controller returns a `Resource` or `ResponseEntity<Resource>`, or a functional endpoint
14+
xref:web/webflux-functional.adoc#webflux-fn-resources[serves a `Resource`]. `Range` header
15+
support is also transparently handled when serving
16+
xref:web/webflux/config.adoc#webflux-config-static-resources[static resources].
17+
18+
The underlying support is in the `HttpRange` class, which exposes methods to parse
19+
`Range` headers and split a `Resource` into a `List<ResourceRegion>` that in turn can be
20+
then written to the response via `ResourceRegionEncoder` and `ResourceHttpMessageWriter`.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[[mvc-range]]
2+
= Range Requests
3+
:page-section-summary-toc: 1
4+
5+
[.small]#xref:web/webflux/range.adoc[See equivalent in the Reactive stack]#
6+
7+
Spring MVC supports https://datatracker.ietf.org/doc/html/rfc9110#section-14[RFC 9110]
8+
range requests. For an overview, see the
9+
https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Range_requests[Ranger Requests]
10+
Mozilla guide.
11+
12+
The `Range` header is parsed and handled transparently in Spring MVC when an annotated
13+
controller returns a `Resource` or `ResponseEntity<Resource>`, or a functional endpoint
14+
xref:web/webmvc-functional.adoc#webmvc-fn-resources[serves a `Resource`]. `Range` header
15+
support is also transparently handled when serving
16+
xref:web/webmvc/mvc-config/static-resources.adoc[static resources].
17+
18+
The underlying support is in the `HttpRange` class, which exposes methods to parse
19+
`Range` headers and split a `Resource` into a `List<ResourceRegion>` that in turn can be
20+
then written to the response via `ResourceRegionHttpMessageConverter`.

0 commit comments

Comments
 (0)