From 4da8fe84c07e3f9e83f9b769f1670f4d52466001 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 22 Jun 2024 12:54:39 +0200 Subject: add switch module --- readme.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'readme.md') diff --git a/readme.md b/readme.md index 451f2dd..cef479e 100644 --- a/readme.md +++ b/readme.md @@ -156,6 +156,24 @@ themselves; in that case the request is passed on. such a form is provided with the distribution of this software, usually in `/usr/share/gnix/login.html` (module) +- **module `switch`** + - Decides between two possible routes based on a condition. + - `condition`: + - `!is_websocket_upgrade`: Checks if a websocket was requested. + - `!is_get`: Checks if this is a GET request + - `!is_post`: Checks if this is a POST request + - `!path_starts_with `: Checks if the URI path starts with some + prefix + - `!path_is `: Checks if the URI path is exactly what you specified + - `!has_header `: Checks if the request includes a certain header. + - `case_true` Handler with matched requests (module) + - `case_false` Handler for all other requests (module) + +- **module `headers`** + - Appends multiple headers to the response. + - `headers`: A map of all header name-value pairs. (object string:string) + - `inner`: The handler to add the headers to. (module) + #### Credentials config format Login credentials for `cookie_auth` and `http_basic_auth` are supplied as either -- cgit v1.2.3-70-g09d2