Commit c4a1b90a8f363ceceb509a95c5ad7b1c15bdb56e

Authored by David RENE
1 parent c8a2ef78

http_action, https_action and http_https_action now return $State instead of (Ma…

…ybe($SessionTicket, Maybe($Sate), List(HTTP_header))
web/CXM_making_a_web_site.anubis
@@ -50,7 +50,7 @@ read system/string.anubis @@ -50,7 +50,7 @@ read system/string.anubis
50 read system/logger.anubis 50 read system/logger.anubis
51 read CXM_common.anubis 51 read CXM_common.anubis
52 read CXM_multihost_http_server.anubis 52 read CXM_multihost_http_server.anubis
53 -read CXM_mime.anubis 53 +read web/mime.anubis
54 read CXM_cookies.anubis 54 read CXM_cookies.anubis
55 55
56 56
@@ -430,20 +430,25 @@ public define Web_Site @@ -430,20 +430,25 @@ public define Web_Site
430 // the second one is just for testing 430 // the second one is just for testing
431 String site_directory, // where 'public' and other directories are 431 String site_directory, // where 'public' and other directories are
432 // located (should NOT end with '/') 432 // located (should NOT end with '/')
  433 + String state_directory,
433 One -> One init, 434 One -> One init,
434 - (HTTP_Info) -> $State initial_state, 435 + (HTTP_Info,
  436 + List(Web_arg),
  437 + Bool is_https) -> $State initial_state,
435 ($State expired, 438 ($State expired,
  439 + Maybe(String),
436 HTTP_Info, 440 HTTP_Info,
437 List(Web_arg), 441 List(Web_arg),
438 Bool is_https) -> $State ticket_expired_state, 442 Bool is_https) -> $State ticket_expired_state,
439 - (HTTP_Info, 443 + (Maybe(String),
  444 + HTTP_Info,
440 List(Web_arg), 445 List(Web_arg),
441 Bool is_https) -> $State ticket_lost_state, 446 Bool is_https) -> $State ticket_lost_state,
442 List(Web_Action($State)) actions, 447 List(Web_Action($State)) actions,
443 $State -> HTTP_Answer compute_page, 448 $State -> HTTP_Answer compute_page,
444 $State -> List(HTTP_header) additional_headers, 449 $State -> List(HTTP_header) additional_headers,
445 Int timeout, // seconds (todo: minutes) 450 Int timeout, // seconds (todo: minutes)
446 - List(Redirection) redirections, 451 + Redirections redirections,
447 String charset, 452 String charset,
448 List(String) journal_extensions, 453 List(String) journal_extensions,
449 List(String) journal_headers, 454 List(String) journal_headers,
@@ -2276,6 +2281,40 @@ define List(HTTP_header) @@ -2276,6 +2281,40 @@ define List(HTTP_header)
2276 ] 2281 ]
2277 . 2282 .
2278 2283
  2284 + public define Web_Site
  2285 + make_web_site_description
  2286 + (
  2287 + List(String) common_names, // for example: ["www.our-business.com",
  2288 + // "192.168.0.1"]
  2289 + // the second one is just for testing
  2290 + String site_directory, // where 'public' and other directories are
  2291 + // located (should NOT end with '/')
  2292 + One -> One init,
  2293 + (HTTP_Info,
  2294 + List(Web_arg),
  2295 + Bool is_https) -> $State initial_state,
  2296 + ($State expired,
  2297 + HTTP_Info,
  2298 + List(Web_arg),
  2299 + Bool is_https) -> $State ticket_expired_state,
  2300 + (HTTP_Info,
  2301 + List(Web_arg),
  2302 + Bool is_https) -> $State ticket_lost_state,
  2303 + List(Web_Action($State)) actions,
  2304 + $State -> HTTP_Answer compute_page,
  2305 + $State -> List(HTTP_header) additional_headers,
  2306 + Int timeout, // seconds (todo: minutes)
  2307 + Redirections redirections,
  2308 + String charset,
  2309 + List(String) journal_extensions,
  2310 + List(String) journal_headers,
  2311 + String authorization_secret,
  2312 + List(MIME) known_mime_types,
  2313 + (String action_name,
  2314 + List(Web_arg) args)-> One before_send_file
  2315 + ).
  2316 +
  2317 +
2279 public define Web_Site 2318 public define Web_Site
2280 make_web_site_description 2319 make_web_site_description
2281 ( 2320 (
web/CXM_mime.anubis
@@ -14,20 +14,20 @@ read tools/base64.anubis @@ -14,20 +14,20 @@ read tools/base64.anubis
14 read tools/basis.anubis 14 read tools/basis.anubis
15 read system/string.anubis 15 read system/string.anubis
16 16
17 -public type MIME: 17 + public type MIME:
18 mime(String type, 18 mime(String type,
19 String sybtype, 19 String sybtype,
20 List(String) file_extensions). 20 List(String) file_extensions).
21 21
22 22
23 -public define Bool 23 + public define Bool
24 MIME x = MIME y 24 MIME x = MIME y
25 = 25 =
26 if x is mime(x_type, x_subtype, _) then 26 if x is mime(x_type, x_subtype, _) then
27 if y is mime(y_type, y_subtype, _) then 27 if y is mime(y_type, y_subtype, _) then
28 insensitive_equal(x_type, y_type) & insensitive_equal(x_subtype, y_subtype). 28 insensitive_equal(x_type, y_type) & insensitive_equal(x_subtype, y_subtype).
29 29
30 -public define List(MIME) 30 + public define List(MIME)
31 known_mime_types 31 known_mime_types
32 = 32 =
33 [ 33 [
@@ -50,7 +50,7 @@ public define List(MIME) @@ -50,7 +50,7 @@ public define List(MIME)
50 mime("message", "rfc822", [".eml"]), 50 mime("message", "rfc822", [".eml"]),
51 ]. 51 ].
52 52
53 -public define String 53 + public define String
54 to_String 54 to_String
55 ( 55 (
56 MIME mime_type 56 MIME mime_type
@@ -58,7 +58,7 @@ public define String @@ -58,7 +58,7 @@ public define String
58 if mime_type is mime(type, subtype, _) then 58 if mime_type is mime(type, subtype, _) then
59 type + "/" + subtype. 59 type + "/" + subtype.
60 60
61 -public define String 61 + public define String
62 to_MIME_text 62 to_MIME_text
63 ( 63 (
64 String charset, 64 String charset,
web/CXM_multihost_http_server.anubis
@@ -169,7 +169,7 @@ read tools/printable_tree.anubis @@ -169,7 +169,7 @@ read tools/printable_tree.anubis
169 read system/string.anubis 169 read system/string.anubis
170 read system/files.anubis 170 read system/files.anubis
171 read system/lists.anubis 171 read system/lists.anubis
172 -read CXM_mime.anubis 172 +read web/mime.anubis
173 173
174 174
175 175