Commit 9bc1917a authored by Stefan Eissing's avatar Stefan Eissing
Browse files

Merge of r1855705 from trunk:

core: merge consecutive slashes in the path



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855737 13f79535-47bb-0310-9956-ffa450edef68
parent d42459cf
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.4.39

  *) core: new configuration option 'MergeSlashes on|off' that controls handling of
     multiple, consecutive slash ('/') characters in the path component of the request URL.
     [Eric Covener]
     
  *) mod_http2: when SSL renegotiation is inhibited and a 403 ErrorDocument is
     in play, the proper HTTP/2 stream reset did not trigger with H2_ERR_HTTP_1_1_REQUIRED.
     Fixed. [Michael Kaufmann] 
+26 −0
Original line number Diff line number Diff line
@@ -5138,4 +5138,30 @@ recognized methods to modules.</p>
<seealso><directive module="mod_allowmethods">AllowMethods</directive></seealso>
</directivesynopsis>

<directivesynopsis>
<name>MergeSlashes</name>
<description>Controls whether the server merges consecutive slashes in URLs.
</description>
<syntax>MergeSlashes ON|OFF</syntax>
<default>MergeSlashes ON</default>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<compatibility>Added in 2.5.1</compatibility>

<usage>
    <p>By default, the server merges (or collapses) multiple consecutive slash
    ('/') characters in the path component of the request URL.</p>

    <p>When mapping URL's to the filesystem, these multiple slashes are not 
    significant.  However, URL's handled other ways, such as by CGI or proxy,
    might prefer to retain the significance of multiple consecutive slashes. 
    In these cases <directive>MergeSlashes</directive> can be set to 
    <em>OFF</em> to retain the multiple consecutive slashes.  In these
    configurations, regular expressions used in the configuration file that match
    the path component of the URL (<directive>LocationMatch</directive>,
    <directive>RewriteRule</directive>, ...) need to take into account multiple 
    consecutive slashes.</p>
</usage>
</directivesynopsis>

</modulesynopsis>
+3 −1
Original line number Diff line number Diff line
@@ -523,6 +523,8 @@
 * 20120211.82 (2.4.35-dev) Add optional function declaration for
 *                          ap_proxy_balancer_get_best_worker to mod_proxy.h.
 * 20120211.83 (2.4.35-dev) Add client64 field to worker_score struct
 * 20120211.84 (2.4.35-dev) Add ap_no2slash_ex() and merge_slashes to 
 *                          core_server_conf.
 *
 */

@@ -531,7 +533,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20120211
#endif
#define MODULE_MAGIC_NUMBER_MINOR 83                  /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 84                  /* 0...n */

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+1 −1
Original line number Diff line number Diff line
@@ -740,7 +740,7 @@ typedef struct {
#define AP_HTTP_METHODS_LENIENT       1
#define AP_HTTP_METHODS_REGISTERED    2
    char http_methods;

    unsigned int merge_slashes;
} core_server_config;

/* for AddOutputFiltersByType in core.c */
+12 −2
Original line number Diff line number Diff line
@@ -1697,11 +1697,21 @@ AP_DECLARE(int) ap_unescape_url_keep2f(char *url, int decode_slashes);
AP_DECLARE(int) ap_unescape_urlencoded(char *query);

/**
 * Convert all double slashes to single slashes
 * @param name The string to convert
 * Convert all double slashes to single slashes, except where significant
 * to the filesystem on the current platform.
 * @param name The string to convert, assumed to be a filesystem path
 */
AP_DECLARE(void) ap_no2slash(char *name);

/**
 * Convert all double slashes to single slashes, except where significant
 * to the filesystem on the current platform.
 * @param name The string to convert
 * @param is_fs_path if set to 0, the significance of any double-slashes is 
 *        ignored.
 */
AP_DECLARE(void) ap_no2slash_ex(char *name, int is_fs_path);

/**
 * Remove all ./ and xx/../ substrings from a file name. Also remove
 * any leading ../ or /../ substrings.
Loading