pike.git / lib / modules / Tools.pmod / Standalone.pmod / httpserver.pike

version» Context lines:

pike.git/lib/modules/Tools.pmod/Standalone.pmod/httpserver.pike:82:    "<html><body><h1>File not found</h1>\n"    "<tt>" + Parser.encode_html_entities(fname) + "</tt><br />\n"    "</body></html>\n";   }      void handle_request(Protocols.HTTP.Server.Request request)   {    string file = "."+combine_path("/",request->not_query);    file = Protocols.HTTP.uri_decode(file);    Stdio.Stat s = file_stat( file ); +  +  mapping hdr = ([]); +     if( !s )    request->response_and_finish( (["data":    file_not_found(request->not_query),    "type":"text/html", -  +  "extra_heads" : hdr,    "error":404]) );    else if( s->isdir )    request->response_and_finish( ([ "data":dirlist(file), -  +  "extra_heads" : hdr,    "type":"text/html" ]) );    else -  request->response_and_finish( ([ "file":Stdio.File(file) ]) ); +  request->response_and_finish( ([ "file":Stdio.File(file), +  "extra_heads" : hdr, +  ]) );   }