cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
waf.h
Go to the documentation of this file.
1
2#ifndef __CWIST_WAF_H__
3#define __CWIST_WAF_H__
4
5#include <stdbool.h>
6#include <stddef.h>
7#include <cwist/sys/app/app.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
14bool cwist_waf_is_safe(const char *input, size_t length);
15char *cwist_sanitize_html(const char *input);
16
17#ifdef __cplusplus
18}
19#endif
20#endif
Core Application Structure and Lifecycle Management.
void(* cwist_middleware_func)(cwist_http_request *req, cwist_http_response *res, cwist_handler_func next)
Middleware type that receives req/res pair and the next stage in the chain.
Definition app.h:115
cwist_middleware_func cwist_mw_waf_lite(void)
Construct the WAF-lite middleware.
Definition waf.c:218
char * cwist_sanitize_html(const char *input)
Escape HTML-special characters in a NUL-terminated string.
Definition waf.c:141
bool cwist_waf_is_safe(const char *input, size_t length)
Check whether a byte string is free of hostile signatures.
Definition waf.c:113