From d783e794c2fa6a9e6bffff9f41cdb7e8033bf3c3 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 27 Feb 2026 12:30:45 +0100 Subject: Add http_strncasecmp(3) POSIX.1-2008 does not any locale-specific version of strncasecmp(3), so conversions to lowercase depend on the system locale. Since HTTP header fields must be checked without case sensitivity and not depend on the system locale, a specialised function that forces the "POSIX" locale is required. --- include/libweb/http.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/libweb/http.h b/include/libweb/http.h index ad4ebcd..41e1dce 100644 --- a/include/libweb/http.h +++ b/include/libweb/http.h @@ -150,5 +150,6 @@ char *http_cookie_create(const char *key, const char *value, const struct tm *exp); char *http_encode_url(const char *url); int http_decode_url(const char *url, bool spaces, char **out); +int http_strncasecmp(const char *s1, const char *s2, size_t n); #endif /* HTTP_H */ -- cgit v1.2.3