Commit 756d95f0 authored by Eric Covener's avatar Eric Covener
Browse files

change short-lived behavior of "DirectoryIndex None" based on feedback from wrowe:

Doesn't search for anything:
  DirectoryIndex disabled

Does search for literal "disabled":
  DirectoryIndex disabled foo.
  DirectoryIndex foo disabled 
  DirectoryIndex disabled disabled 

Does search:
  DirectoryIndex disabled.html



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@713462 13f79535-47bb-0310-9956-ffa450edef68
parent 5828ce73
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>List of resources to look for when the client requests
a directory</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DirectoryIndex
    None | <var>local-url</var> [<var>local-url</var>] ...</code></td></tr>
    disabled | <var>local-url</var> [<var>local-url</var>] ...</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DirectoryIndex index.html</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
@@ -105,8 +105,10 @@ a directory</td></tr>
    executed if neither <code>index.html</code> or <code>index.txt</code>
    existed in a directory.</p>

    <p>A value of "None" prevents <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> from 
    searching for an index.</p>
    <p>A single argument of "disabled" prevents <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> from 
    searching for an index.  An argument of "disabled" will be interpeted
    literally if it has any arguments before or after it, even if they are "disabled"
    as well.</p>


</div>
+5 −3
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@
<description>List of resources to look for when the client requests
a directory</description>
<syntax>DirectoryIndex
    None | <var>local-url</var> [<var>local-url</var>] ...</syntax>
    disabled | <var>local-url</var> [<var>local-url</var>] ...</syntax>
<default>DirectoryIndex index.html</default>
<contextlist><context>server config</context><context>virtual host</context>
<context>directory</context><context>.htaccess</context></contextlist>
@@ -95,8 +95,10 @@ a directory</description>
    executed if neither <code>index.html</code> or <code>index.txt</code>
    existed in a directory.</p>

    <p>A value of "None" prevents <module>mod_dir</module> from 
    searching for an index.</p>
    <p>A single argument of "disabled" prevents <module>mod_dir</module> from 
    searching for an index.  An argument of "disabled" will be interpeted
    literally if it has any arguments before or after it, even if they are "disabled"
    as well.</p>

</usage>
</directivesynopsis>
+0 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8" ?>
<!-- GENERATED FROM XML: DO NOT EDIT -->

<metafile>
  <basename>mod_dir</basename>
+21 −4
Original line number Diff line number Diff line
@@ -47,13 +47,30 @@ typedef struct dir_config_struct {
static const char *add_index(cmd_parms *cmd, void *dummy, const char *arg)
{
    dir_config_rec *d = dummy;
    const char *t, *w;
    int count = 0;
   
    if (!d->index_names) {
        d->index_names = apr_array_make(cmd->pool, 2, sizeof(char *));
    }
    if (strcasecmp(arg, "none")) { 
        *(const char **)apr_array_push(d->index_names) = arg;

    t = arg;
    while ((w = ap_getword_conf(cmd->pool, &t)) && w[0]) { 
        if (count == 0 && !strcasecmp(w, "disabled")) { 
            /* peek to see if "disabled" is first in a series of arguments */
            const char *tt = t;
            fprintf(stderr, "t:'%s'\n", t);
            const char *ww = ap_getword_conf(cmd->pool, &tt);
            if (ww == NULL || !ww[0]) { 
               /* "disabled" is first, and alone */
                
               continue;
            }
        }
        *(const char **)apr_array_push(d->index_names) = w;
        count++;
    }

    return NULL;
}

@@ -67,7 +84,7 @@ static const char *configure_slash(cmd_parms *cmd, void *d_, int arg)

static const command_rec dir_cmds[] =
{
    AP_INIT_ITERATE("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS,
    AP_INIT_RAW_ARGS("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS,
                    "a list of file names"),
    AP_INIT_FLAG("DirectorySlash", configure_slash, NULL, DIR_CMD_PERMS,
                 "On or Off"),