diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-10-24 12:38:53 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska@appnovation.com> | 2023-10-24 12:38:53 +0000 |
| commit | 305385e06f90ca3216e1aa4e43b20dd7d53c1222 (patch) | |
| tree | 899d3460b511567889d5e5d78f77931af572b5fb /src/libtipidee/tipidee_response_header_builtin.c | |
| parent | 37d2f8cb438f68eaa1da8a56ea9ce5023091f128 (diff) | |
| download | tipidee-305385e06f90ca3216e1aa4e43b20dd7d53c1222.tar.gz | |
Make the switch to custom headers
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libtipidee/tipidee_response_header_builtin.c')
| -rw-r--r-- | src/libtipidee/tipidee_response_header_builtin.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/libtipidee/tipidee_response_header_builtin.c b/src/libtipidee/tipidee_response_header_builtin.c deleted file mode 100644 index 0125cb8..0000000 --- a/src/libtipidee/tipidee_response_header_builtin.c +++ /dev/null @@ -1,40 +0,0 @@ -/* ISC license. */ - -#include <string.h> -#include <stdlib.h> - -#include <tipidee/config.h> -#include <tipidee/response.h> - -static tipidee_response_header_builtin const tipidee_response_header_builtin_table_[] = -{ - { .key = "Accept-Ranges", .value = "none" }, - { .key = "Cache-Control", .value = "private" }, - { .key = "Content-Security-Policy", .value = "default-src 'self'; style-src 'self' 'unsafe-inline';" }, - { .key = "Referrer-Policy", .value = "no-referrer-when-downgrade" }, - { .key = "Server", .value = "tipidee/" TIPIDEE_VERSION }, - { .key = "Vary", .value = "Accept-Encoding" }, - { .key = "X-Content-Type-Options", .value = "nosniff" }, - { .key = "X-Frame-Options", .value = "DENY" }, - { .key = "X-XSS-Protection", .value = "1; mode=block" }, - { .key = 0, .value = 0 }, -} ; - -tipidee_response_header_builtin const *tipidee_response_header_builtin_table = tipidee_response_header_builtin_table_ ; - -static int tipidee_response_header_builtin_cmp (void const *a, void const *b) -{ - return strcmp((char const *)a, ((tipidee_response_header_builtin const *)b)->key) ; -} - -char const *tipidee_response_header_builtin_search (char const *key) -{ - tipidee_response_header_builtin const *p = bsearch( - key, - tipidee_response_header_builtin_table_, - sizeof(tipidee_response_header_builtin_table_) / sizeof(tipidee_response_header_builtin) - 1, - sizeof(tipidee_response_header_builtin), - &tipidee_response_header_builtin_cmp) ; - return p ? p->value : 0 ; -} - |
