You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2024/09/27 13:10:34 UTC

svn commit: r1920981 - in /httpd/httpd/branches/2.4.x: ./ CHANGES modules/filters/mod_ext_filter.c modules/generators/mod_autoindex.c modules/http/byterange_filter.c modules/http/http_request.c modules/proxy/mod_proxy_ftp.c

Author: covener
Date: Fri Sep 27 13:10:34 2024
New Revision: 1920981

URL: http://svn.apache.org/viewvc?rev=1920981&view=rev
Log:
Merge r1427465, r1918823 from trunk:

Remove support for Request-Range header sent by Navigator 2-3 and
MSIE 3


* Follow up to r1918814: Strings are from configuration and thus trusted

Submitted by: sf, rpluem
Reviewed by: rpluem, covener, jorton

Github: closes #475

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/modules/filters/mod_ext_filter.c
    httpd/httpd/branches/2.4.x/modules/generators/mod_autoindex.c
    httpd/httpd/branches/2.4.x/modules/http/byterange_filter.c
    httpd/httpd/branches/2.4.x/modules/http/http_request.c
    httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ftp.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1427465,1918823

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1920981&r1=1920980&r2=1920981&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Fri Sep 27 13:10:34 2024
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.63
 
+  *) http: Remove support for Request-Range header sent by Navigator 2-3 and
+     MSIE 3. [Stefan Fritsch]
+
   *) mod_rewrite: Don't require [UNC] flag to preserve a leading //
      added by applying the perdir prefix to the substitution.
      [Ruediger Pluem, Eric Covener]

Modified: httpd/httpd/branches/2.4.x/modules/filters/mod_ext_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/filters/mod_ext_filter.c?rev=1920981&r1=1920980&r2=1920981&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/filters/mod_ext_filter.c (original)
+++ httpd/httpd/branches/2.4.x/modules/filters/mod_ext_filter.c Fri Sep 27 13:10:34 2024
@@ -610,7 +610,7 @@ static apr_status_t init_filter_instance
         }
         if (ctx->filter->outtype &&
             ctx->filter->outtype != OUTTYPE_UNCHANGED) {
-            ap_set_content_type(f->r, ctx->filter->outtype);
+            ap_set_content_type_ex(f->r, ctx->filter->outtype, 1);
         }
         if (ctx->filter->preserves_content_length != 1) {
             /* nasty, but needed to avoid confusing the browser

Modified: httpd/httpd/branches/2.4.x/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/generators/mod_autoindex.c?rev=1920981&r1=1920980&r2=1920981&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/generators/mod_autoindex.c (original)
+++ httpd/httpd/branches/2.4.x/modules/generators/mod_autoindex.c Fri Sep 27 13:10:34 2024
@@ -2052,11 +2052,11 @@ static int index_directory(request_rec *
 #endif
     }
     if (*charset) {
-        ap_set_content_type(r, apr_pstrcat(r->pool, ctype, ";charset=",
-                            charset, NULL));
+        ap_set_content_type_ex(r, apr_pstrcat(r->pool, ctype, ";charset=",
+                            charset, NULL), 1);
     }
     else {
-        ap_set_content_type(r, ctype);
+        ap_set_content_type_ex(r, ctype, 1);
     }
 
     if (autoindex_opts & TRACK_MODIFIED) {

Modified: httpd/httpd/branches/2.4.x/modules/http/byterange_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http/byterange_filter.c?rev=1920981&r1=1920980&r2=1920981&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/http/byterange_filter.c (original)
+++ httpd/httpd/branches/2.4.x/modules/http/byterange_filter.c Fri Sep 27 13:10:34 2024
@@ -100,21 +100,7 @@ static int ap_set_byterange(request_rec
         return 0;
     }
 
-    /*
-     * Check for Range request-header (HTTP/1.1) or Request-Range for
-     * backwards-compatibility with second-draft Luotonen/Franks
-     * byte-ranges (e.g. Netscape Navigator 2-3).
-     *
-     * We support this form, with Request-Range, and (farther down) we
-     * send multipart/x-byteranges instead of multipart/byteranges for
-     * Request-Range based requests to work around a bug in Netscape
-     * Navigator 2-3 and MSIE 3.
-     */
-
-    if (!(range = apr_table_get(r->headers_in, "Range"))) {
-        range = apr_table_get(r->headers_in, "Request-Range");
-    }
-
+    range = apr_table_get(r->headers_in, "Range");
     if (!range || strncasecmp(range, "bytes=", 6) || r->status != HTTP_OK) {
         return 0;
     }
@@ -126,10 +112,9 @@ static int ap_set_byterange(request_rec
 
     /* is content already a multiple range? */
     if ((ct = apr_table_get(r->headers_out, "Content-Type"))
-        && (!strncasecmp(ct, "multipart/byteranges", 20)
-            || !strncasecmp(ct, "multipart/x-byteranges", 22))) {
+        && strncasecmp(ct, "multipart/byteranges", 20) == 0) {
             return 0;
-        }
+    }
 
     /*
      * Check the If-Range header for Etag or Date.
@@ -298,21 +283,6 @@ static int ap_set_byterange(request_rec
     return num_ranges;
 }
 
-/*
- * Here we try to be compatible with clients that want multipart/x-byteranges
- * instead of multipart/byteranges (also see above), as per HTTP/1.1. We
- * look for the Request-Range header (e.g. Netscape 2 and 3) as an indication
- * that the browser supports an older protocol. We also check User-Agent
- * for Microsoft Internet Explorer 3, which needs this as well.
- */
-static int use_range_x(request_rec *r)
-{
-    const char *ua;
-    return (apr_table_get(r->headers_in, "Request-Range")
-            || ((ua = apr_table_get(r->headers_in, "User-Agent"))
-                && ap_strstr_c(ua, "MSIE 3")));
-}
-
 #define BYTERANGE_FMT "%" APR_OFF_T_FMT "-%" APR_OFF_T_FMT "/%" APR_OFF_T_FMT
 
 static apr_status_t copy_brigade_range(apr_bucket_brigade *bb,
@@ -503,10 +473,9 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
         /* Is ap_make_content_type required here? */
         const char *orig_ct = ap_make_content_type(r, r->content_type);
 
-        ap_set_content_type(r, apr_pstrcat(r->pool, "multipart",
-                                           use_range_x(r) ? "/x-" : "/",
-                                           "byteranges; boundary=",
-                                           ap_multipart_boundary, NULL));
+        ap_set_content_type_ex(r, apr_pstrcat(r->pool,
+                                           "multipart/byteranges; boundary=",
+                                           ap_multipart_boundary, NULL), 1);
 
         if (orig_ct) {
             bound_head = apr_pstrcat(r->pool,

Modified: httpd/httpd/branches/2.4.x/modules/http/http_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http/http_request.c?rev=1920981&r1=1920980&r2=1920981&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/http/http_request.c (original)
+++ httpd/httpd/branches/2.4.x/modules/http/http_request.c Fri Sep 27 13:10:34 2024
@@ -808,7 +808,7 @@ AP_DECLARE(void) ap_internal_redirect_ha
     }
 
     if (r->handler)
-        ap_set_content_type(new, r->content_type);
+        ap_set_content_type_ex(new, r->content_type, AP_REQUEST_IS_TRUSTED_CT(r));
     access_status = ap_process_request_internal(new);
     if (access_status == OK) {
         access_status = ap_invoke_handler(new);

Modified: httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ftp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ftp.c?rev=1920981&r1=1920980&r2=1920981&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ftp.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ftp.c Fri Sep 27 13:10:34 2024
@@ -1878,10 +1878,10 @@ static int proxy_ftp_handler(request_rec
 
     /* set content-type */
     if (dirlisting) {
-        ap_set_content_type(r, apr_pstrcat(p, "text/html;charset=",
+        ap_set_content_type_ex(r, apr_pstrcat(p, "text/html;charset=",
                                            fdconf->ftp_directory_charset ?
                                            fdconf->ftp_directory_charset :
-                                           "ISO-8859-1",  NULL));
+                                           "ISO-8859-1",  NULL), 1);
     }
     else {
         if (xfer_type != 'A' && size != NULL) {