// lookupFile find the file to serve
// if the file is dir ,search the index.html as default file( MUST NOT A DIR also)
// if the index.html not exist or is a dir, give a forbidden response depending on  DirectoryIndex

lookupFile find the file to serve
if the file is dir ,search the index.html as default file( MUST NOT A DIR also)
if the index.html not exist or is a dir, give a forbidden response depending on  DirectoryIndex
// lookupFile find the file to serve // if the file is dir search the index . html as default file ( MUST NOT A DIR also ) // if the index . html not exist or is a dir give a forbidden response depending on DirectoryIndex
func lookupFile(ctx *context.Context) (bool, string, os.FileInfo, error) {
	fp, fi, err := searchFile(ctx)
	if fp == "" || fi == nil {
		return false, "", nil, err
	}
	if !fi.IsDir() {
		return false, fp, fi, err
	}
	if requestURL := ctx.Input.URL(); requestURL[len(requestURL)-1] == '/' {
		ifp := filepath.Join(fp, "index.html")
		if ifi, _ := os.Stat(ifp); ifi != nil && ifi.Mode().IsRegular() {
			return false, ifp, ifi, err
		}
	}
	return !BConfig.WebConfig.DirectoryIndex, fp, fi, err
}
func lookupFile ( ctx * context . Context ) ( bool , string , os . FileInfo , error ) { fp , fi , err := searchFile ( ctx ) if fp == " " || fi == nil { return false , " " , nil , err } if ! fi . IsDir ( ) { return false , fp , fi , err } if requestURL := ctx . Input . URL ( ) ; requestURL [ len ( requestURL ) - 1 ] == '/' { ifp := filepath . Join ( fp , " " ) if ifi , _ := os . Stat ( ifp ) ; ifi != nil && ifi . Mode ( ) . IsRegular ( ) { return false , ifp , ifi , err } } return ! BConfig . WebConfig . DirectoryIndex , fp , fi , err }
lookupFile find the file to serve
if the file is dir ,search the index.html as default file( MUST NOT A DIR also)
if the index.html not exist or is a dir, give a forbidden response depending on  DirectoryIndex
lookupFile find the file to serve if the file is dir search the index . html as default file ( MUST NOT A DIR also ) if the index . html not exist or is a dir give a forbidden response depending on DirectoryIndex