Roxen.git / server / modules / directories / indexfiles.pike

version» Context lines:

Roxen.git/server/modules/directories/indexfiles.pike:1:   // This is a roxen module. Copyright © 1996 - 2009, Roxen IS.      // Index files only module, a directory module that will not try to   // generate any directory listings, instead only using index files.    - constant cvs_version = "$Id: indexfiles.pike,v 1.24 2009/05/07 14:15:54 mast Exp $"; + constant cvs_version = "$Id$";   constant thread_safe = 1;      inherit "module";   #include <module.h>      //<locale-token project="mod_indexfiles">LOCALE</locale-token>   #define LOCALE(X,Y) _DEF_LOCALE("mod_indexfiles",X,Y)   // end locale stuff      //************** Generic module stuff ***************
Roxen.git/server/modules/directories/indexfiles.pike:38:   // The only important function in this file...   // Given a request ID, try to find a matching index file.   // If one is found, return it, if not, simply return "no such file" (0)   mapping parse_directory(RequestID id)   {    // Redirect to an url with a '/' at the end, to make relative links    // work as expected.    string f = id->not_query;    if(strlen(f) > 1)    { -  if(f[-1]!='/') return Roxen.http_redirect(f+"/", id); +  if(f[-1]!='/') +  // Don't expose internal path if the request has been internally +  // redirected already. +  return Roxen.http_redirect((id->misc->redirected_not_query || f) + "/", id);    if(f[-1]=='/' && has_value(f, "//")) -  +  // Dead code because the path has already been normalized?    return Roxen.http_redirect("/"+(f/"/"-({""}))*"/"+"/", id);    }       foreach(indexfiles, string file)    {    array s;    if((s = id->conf->stat_file(f+file, id)) && (s[ST_SIZE] >= 0))    {    id->not_query = f+file;    mixed result = id->conf->handle_request(id);