diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-27 12:30:45 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-27 16:28:52 +0100 |
| commit | d783e794c2fa6a9e6bffff9f41cdb7e8033bf3c3 (patch) | |
| tree | dd7d835b79db8d9ed1c5cdfdbc82f8f3d694ba95 /include | |
| parent | fca0679e438e1cf8a3db9047f57d3b2363ab417e (diff) | |
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.
Diffstat (limited to 'include')
| -rw-r--r-- | include/libweb/http.h | 1 |
1 files changed, 1 insertions, 0 deletions
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 */ |
