Commit c4a1b90a8f363ceceb509a95c5ad7b1c15bdb56e
1 parent
c8a2ef78
http_action, https_action and http_https_action now return $State instead of (Ma…
…ybe($SessionTicket, Maybe($Sate), List(HTTP_header))
Showing
3 changed files
with
49 additions
and
10 deletions
Show diff stats
web/CXM_making_a_web_site.anubis
| ... | ... | @@ -50,7 +50,7 @@ read system/string.anubis |
| 50 | 50 | read system/logger.anubis |
| 51 | 51 | read CXM_common.anubis |
| 52 | 52 | read CXM_multihost_http_server.anubis |
| 53 | -read CXM_mime.anubis | |
| 53 | +read web/mime.anubis | |
| 54 | 54 | read CXM_cookies.anubis |
| 55 | 55 | |
| 56 | 56 | |
| ... | ... | @@ -430,20 +430,25 @@ public define Web_Site |
| 430 | 430 | // the second one is just for testing |
| 431 | 431 | String site_directory, // where 'public' and other directories are |
| 432 | 432 | // located (should NOT end with '/') |
| 433 | + String state_directory, | |
| 433 | 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 | 438 | ($State expired, |
| 439 | + Maybe(String), | |
| 436 | 440 | HTTP_Info, |
| 437 | 441 | List(Web_arg), |
| 438 | 442 | Bool is_https) -> $State ticket_expired_state, |
| 439 | - (HTTP_Info, | |
| 443 | + (Maybe(String), | |
| 444 | + HTTP_Info, | |
| 440 | 445 | List(Web_arg), |
| 441 | 446 | Bool is_https) -> $State ticket_lost_state, |
| 442 | 447 | List(Web_Action($State)) actions, |
| 443 | 448 | $State -> HTTP_Answer compute_page, |
| 444 | 449 | $State -> List(HTTP_header) additional_headers, |
| 445 | 450 | Int timeout, // seconds (todo: minutes) |
| 446 | - List(Redirection) redirections, | |
| 451 | + Redirections redirections, | |
| 447 | 452 | String charset, |
| 448 | 453 | List(String) journal_extensions, |
| 449 | 454 | List(String) journal_headers, |
| ... | ... | @@ -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 | 2318 | public define Web_Site |
| 2280 | 2319 | make_web_site_description |
| 2281 | 2320 | ( | ... | ... |
web/CXM_mime.anubis
| ... | ... | @@ -14,20 +14,20 @@ read tools/base64.anubis |
| 14 | 14 | read tools/basis.anubis |
| 15 | 15 | read system/string.anubis |
| 16 | 16 | |
| 17 | -public type MIME: | |
| 17 | + public type MIME: | |
| 18 | 18 | mime(String type, |
| 19 | 19 | String sybtype, |
| 20 | 20 | List(String) file_extensions). |
| 21 | 21 | |
| 22 | 22 | |
| 23 | -public define Bool | |
| 23 | + public define Bool | |
| 24 | 24 | MIME x = MIME y |
| 25 | 25 | = |
| 26 | 26 | if x is mime(x_type, x_subtype, _) then |
| 27 | 27 | if y is mime(y_type, y_subtype, _) then |
| 28 | 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 | 31 | known_mime_types |
| 32 | 32 | = |
| 33 | 33 | [ |
| ... | ... | @@ -50,7 +50,7 @@ public define List(MIME) |
| 50 | 50 | mime("message", "rfc822", [".eml"]), |
| 51 | 51 | ]. |
| 52 | 52 | |
| 53 | -public define String | |
| 53 | + public define String | |
| 54 | 54 | to_String |
| 55 | 55 | ( |
| 56 | 56 | MIME mime_type |
| ... | ... | @@ -58,7 +58,7 @@ public define String |
| 58 | 58 | if mime_type is mime(type, subtype, _) then |
| 59 | 59 | type + "/" + subtype. |
| 60 | 60 | |
| 61 | -public define String | |
| 61 | + public define String | |
| 62 | 62 | to_MIME_text |
| 63 | 63 | ( |
| 64 | 64 | String charset, | ... | ... |
web/CXM_multihost_http_server.anubis