diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-22 12:54:39 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-22 12:54:39 +0200 |
commit | 4da8fe84c07e3f9e83f9b769f1670f4d52466001 (patch) | |
tree | bf4384034771001b136207c4df386daf99dac7fa /readme.md | |
parent | 1451273fa59d14070e525562ec466a21128fa671 (diff) | |
download | gnix-4da8fe84c07e3f9e83f9b769f1670f4d52466001.tar gnix-4da8fe84c07e3f9e83f9b769f1670f4d52466001.tar.bz2 gnix-4da8fe84c07e3f9e83f9b769f1670f4d52466001.tar.zst |
add switch module
Diffstat (limited to 'readme.md')
-rw-r--r-- | readme.md | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 <prefix>`: Checks if the URI path starts with some + prefix + - `!path_is <path>`: Checks if the URI path is exactly what you specified + - `!has_header <name>`: 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 |