aboutsummaryrefslogtreecommitdiff
path: root/handler.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-04-23 05:09:53 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-04-23 05:09:53 +0200
commit011807e1d69d196cd0b9fd39a9899eb335c81abf (patch)
tree4f5060c6f48376709d1d463780f90618882d4068 /handler.c
parent2e2c9b4c93e7469f290f6c9a2c89ed5e41c2cd54 (diff)
downloadslcl-011807e1d69d196cd0b9fd39a9899eb335c81abf.tar.gz
Support URL parameters
Now, http_payload includes a list of human-readable parameters that can be read (but not modified) by users. Given the following example link: /test?key1=value1&key2=value2 This will generate two parameters, with the following values: { .args = { [0] = {.key = "key1", .value = "value1"}, [1] = {.key = "key2", .value = "value2"} }, .n_args = 2 } As expected, if any URL parameters are given, struct http_payload member "resource" is accordingly trimmed so as not to include any parameters. Therefore, considering the example above: {.args = {...}, .resource = "/test"} Limitations: - Since the definition of struct http_arg is both shared by http.h (as a read-only pointer within struct http_payload) and http.c (as a read/write pointer within struct ctx), its members (namely key and value) must remain as read/write pointers, even if they must not be modified by users of http.h.
Diffstat (limited to 'handler.c')
0 files changed, 0 insertions, 0 deletions