Skip to content

Commit 335c827

Browse files
committed
Deprecate useAcceptRanges
1 parent a4ab047 commit 335c827

4 files changed

Lines changed: 15 additions & 0 deletions

File tree

conf/web.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
<!-- -->
8585
<!-- useAcceptRanges Should the Accept-Ranges header be included -->
8686
<!-- in responses where appropriate? [true] -->
87+
<!-- Deprecated. This option will be removed -->
88+
<!-- without replacement in Tomcat 12 onwards where -->
89+
<!-- it will effectively be hard coded to true. -->
8790
<!-- -->
8891
<!-- For directory listing customization. Checks localXsltFile, then -->
8992
<!-- globalXsltFile, then defaults to original behavior. -->

java/org/apache/catalina/servlets/DefaultServlet.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,11 @@ public class DefaultServlet extends HttpServlet {
237237

238238
/**
239239
* Should the Accept-Ranges: bytes header be send with static resources?
240+
*
241+
* @deprecated This option will be removed without replacement in Tomcat 12 onwards where it will effectively be
242+
* hard coded to {@code true}.
240243
*/
244+
@Deprecated
241245
protected boolean useAcceptRanges = true;
242246

243247
/**

webapps/docs/changelog.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@
223223
only be processed for <code>GET</code> requests. Based on pull request
224224
<pr>790</pr> provided by Chenjp. (markt)
225225
</fix>
226+
<fix>
227+
Deprecate the <code>useAcceptRanges</code> initialisation parameter for
228+
the default servlet. It will be removed in Tomcat 12 onwards where it
229+
will effectively be hard coded to <code>true</code>. (markt)
230+
</fix>
226231
</changelog>
227232
</subsection>
228233
<subsection name="Coyote">

webapps/docs/default-servlet.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ Tomcat.</p>
194194
<property name="useAcceptRanges">
195195
If true, the Accept-Ranges header will be set when appropriate for the
196196
response. [true]
197+
<br/>
198+
Deprecated. This option will be removed without replacement in Tomcat
199+
12 onwards where it will effectively be hard coded to <code>true</code>.
197200
</property>
198201
<property name="showServerInfo">
199202
Should server information be presented in the response sent to clients

0 commit comments

Comments
 (0)