@@ -100,21 +100,7 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength,
100100 return 0 ;
101101 }
102102
103- /*
104- * Check for Range request-header (HTTP/1.1) or Request-Range for
105- * backwards-compatibility with second-draft Luotonen/Franks
106- * byte-ranges (e.g. Netscape Navigator 2-3).
107- *
108- * We support this form, with Request-Range, and (farther down) we
109- * send multipart/x-byteranges instead of multipart/byteranges for
110- * Request-Range based requests to work around a bug in Netscape
111- * Navigator 2-3 and MSIE 3.
112- */
113-
114- if (!(range = apr_table_get (r -> headers_in , "Range" ))) {
115- range = apr_table_get (r -> headers_in , "Request-Range" );
116- }
117-
103+ range = apr_table_get (r -> headers_in , "Range" );
118104 if (!range || strncasecmp (range , "bytes=" , 6 ) || r -> status != HTTP_OK ) {
119105 return 0 ;
120106 }
@@ -126,10 +112,9 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength,
126112
127113 /* is content already a multiple range? */
128114 if ((ct = apr_table_get (r -> headers_out , "Content-Type" ))
129- && (!strncasecmp (ct , "multipart/byteranges" , 20 )
130- || !strncasecmp (ct , "multipart/x-byteranges" , 22 ))) {
115+ && strncasecmp (ct , "multipart/byteranges" , 20 ) == 0 ) {
131116 return 0 ;
132- }
117+ }
133118
134119 /*
135120 * Check the If-Range header for Etag or Date.
@@ -298,21 +283,6 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength,
298283 return num_ranges ;
299284}
300285
301- /*
302- * Here we try to be compatible with clients that want multipart/x-byteranges
303- * instead of multipart/byteranges (also see above), as per HTTP/1.1. We
304- * look for the Request-Range header (e.g. Netscape 2 and 3) as an indication
305- * that the browser supports an older protocol. We also check User-Agent
306- * for Microsoft Internet Explorer 3, which needs this as well.
307- */
308- static int use_range_x (request_rec * r )
309- {
310- const char * ua ;
311- return (apr_table_get (r -> headers_in , "Request-Range" )
312- || ((ua = apr_table_get (r -> headers_in , "User-Agent" ))
313- && ap_strstr_c (ua , "MSIE 3" )));
314- }
315-
316286#define BYTERANGE_FMT "%" APR_OFF_T_FMT "-%" APR_OFF_T_FMT "/%" APR_OFF_T_FMT
317287
318288static apr_status_t copy_brigade_range (apr_bucket_brigade * bb ,
@@ -503,10 +473,9 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(ap_filter_t *f,
503473 /* Is ap_make_content_type required here? */
504474 const char * orig_ct = ap_make_content_type (r , r -> content_type );
505475
506- ap_set_content_type (r , apr_pstrcat (r -> pool , "multipart" ,
507- use_range_x (r ) ? "/x-" : "/" ,
508- "byteranges; boundary=" ,
509- ap_multipart_boundary , NULL ));
476+ ap_set_content_type_ex (r , apr_pstrcat (r -> pool ,
477+ "multipart/byteranges; boundary=" ,
478+ ap_multipart_boundary , NULL ), 1 );
510479
511480 if (orig_ct ) {
512481 bound_head = apr_pstrcat (r -> pool ,
0 commit comments