diff --git a/web/CXM_making_a_web_site.anubis b/web/CXM_making_a_web_site.anubis index c98ac12..30560c2 100644 --- a/web/CXM_making_a_web_site.anubis +++ b/web/CXM_making_a_web_site.anubis @@ -50,7 +50,7 @@ read system/string.anubis read system/logger.anubis read CXM_common.anubis read CXM_multihost_http_server.anubis -read CXM_mime.anubis +read web/mime.anubis read CXM_cookies.anubis @@ -430,20 +430,25 @@ public define Web_Site // the second one is just for testing String site_directory, // where 'public' and other directories are // located (should NOT end with '/') + String state_directory, One -> One init, - (HTTP_Info) -> $State initial_state, + (HTTP_Info, + List(Web_arg), + Bool is_https) -> $State initial_state, ($State expired, + Maybe(String), HTTP_Info, List(Web_arg), Bool is_https) -> $State ticket_expired_state, - (HTTP_Info, + (Maybe(String), + HTTP_Info, List(Web_arg), Bool is_https) -> $State ticket_lost_state, List(Web_Action($State)) actions, $State -> HTTP_Answer compute_page, $State -> List(HTTP_header) additional_headers, Int timeout, // seconds (todo: minutes) - List(Redirection) redirections, + Redirections redirections, String charset, List(String) journal_extensions, List(String) journal_headers, @@ -2276,6 +2281,40 @@ define List(HTTP_header) ] . + public define Web_Site + make_web_site_description + ( + List(String) common_names, // for example: ["www.our-business.com", + // "192.168.0.1"] + // the second one is just for testing + String site_directory, // where 'public' and other directories are + // located (should NOT end with '/') + One -> One init, + (HTTP_Info, + List(Web_arg), + Bool is_https) -> $State initial_state, + ($State expired, + HTTP_Info, + List(Web_arg), + Bool is_https) -> $State ticket_expired_state, + (HTTP_Info, + List(Web_arg), + Bool is_https) -> $State ticket_lost_state, + List(Web_Action($State)) actions, + $State -> HTTP_Answer compute_page, + $State -> List(HTTP_header) additional_headers, + Int timeout, // seconds (todo: minutes) + Redirections redirections, + String charset, + List(String) journal_extensions, + List(String) journal_headers, + String authorization_secret, + List(MIME) known_mime_types, + (String action_name, + List(Web_arg) args)-> One before_send_file + ). + + public define Web_Site make_web_site_description ( diff --git a/web/CXM_mime.anubis b/web/CXM_mime.anubis index 0d34238..1700df9 100644 --- a/web/CXM_mime.anubis +++ b/web/CXM_mime.anubis @@ -14,20 +14,20 @@ read tools/base64.anubis read tools/basis.anubis read system/string.anubis -public type MIME: + public type MIME: mime(String type, String sybtype, List(String) file_extensions). -public define Bool + public define Bool MIME x = MIME y = if x is mime(x_type, x_subtype, _) then if y is mime(y_type, y_subtype, _) then insensitive_equal(x_type, y_type) & insensitive_equal(x_subtype, y_subtype). -public define List(MIME) + public define List(MIME) known_mime_types = [ @@ -50,7 +50,7 @@ public define List(MIME) mime("message", "rfc822", [".eml"]), ]. -public define String + public define String to_String ( MIME mime_type @@ -58,7 +58,7 @@ public define String if mime_type is mime(type, subtype, _) then type + "/" + subtype. -public define String + public define String to_MIME_text ( String charset, diff --git a/web/CXM_multihost_http_server.anubis b/web/CXM_multihost_http_server.anubis index b0bc12c..b4989c5 100644 --- a/web/CXM_multihost_http_server.anubis +++ b/web/CXM_multihost_http_server.anubis @@ -169,7 +169,7 @@ read tools/printable_tree.anubis read system/string.anubis read system/files.anubis read system/lists.anubis -read CXM_mime.anubis +read web/mime.anubis -- libgit2 0.21.4