summaryrefslogtreecommitdiff
path: root/handler.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-06-16 18:29:59 +0200
committerFelix Fietkau <nbd@nbd.name>2016-06-16 18:29:59 +0200
commit9d9f07142bbef1c63a79620967a847a9493105e5 (patch)
tree24eef6d2f4b4d15c2a3f6c580cde9d115e0f4815 /handler.c
parent242401f544df790b1df7d12b3be5f5b429da091c (diff)
file: add support for disabling cache related precondition checks via handlers
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/handler.c b/handler.c
index 0279a6c..04e71e0 100644
--- a/handler.c
+++ b/handler.c
@@ -121,6 +121,14 @@ handle_add_header(struct json_script_ctx *ctx, struct blob_attr *data)
}
static void
+handle_no_cache(struct json_script_ctx *ctx, struct blob_attr *data)
+{
+ struct client *cl = cur_client;
+
+ cl->dispatch.no_cache = true;
+}
+
+static void
handle_command(struct json_script_ctx *ctx, const char *name,
struct blob_attr *data, struct blob_attr *vars)
{
@@ -131,6 +139,7 @@ handle_command(struct json_script_ctx *ctx, const char *name,
{ "redirect", handle_redirect },
{ "rewrite", handle_set_uri },
{ "add-header", handle_add_header },
+ { "no-cache", handle_no_cache },
};
int i;