file: add support for disabling cache related precondition checks via handlers
[project/uhttpd.git] / handler.c
index 0279a6c1e24228f7e8beed303d84ba8cd89ac686..04e71e0f9ef65f6d99f6d3e82917916fbe2b5616 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -120,6 +120,14 @@ handle_add_header(struct json_script_ctx *ctx, struct blob_attr *data)
                           blobmsg_get_string(tb[1]));
 }
 
+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;