/* * Copyright (C)2005-2022 Haxe Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ type main_function; type client { sock : Net.socket; in : IO.input; out : IO.output; mutable headers : (string, string) list; mutable headers_sent : bool; mutable return_code : (int, string); mutable main : main_function option; } var mime = [ ("gif" , "image/gif"); ("jpeg", "image/jpeg"); ("jpg", "image/jpeg"); ("png", "image/png"); ("css", "text/css"); ("html", "text/html"); ("htm", "text/html"); ("txt", "text/plain"); ("js", "application/javascript"); ("pdf", "application/pdf"); // do we really want that ?? ("xml", "text/xml"); ("wav", "audio/x-wav") ]; var cur_path = &Sys.get_cwd(); var file_log = &None; var module_cache = Hashtbl.create(); var mod_rewrite = &false; function sys_is_file(file) { neko "$loader.loadprim('std@sys_file_type',1)(file)" == "file" } function default_page_404(url) { "