From fca491e03642ada516fe8386397aa166c92c284e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 16 Apr 2026 17:31:59 +0200 Subject: [PATCH] shared/webutil: reorder .c to match .h, mark one more function as _pure_ --- src/shared/web-util.c | 26 +++++++++++++------------- src/shared/web-util.h | 4 +--- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/shared/web-util.c b/src/shared/web-util.c index 628f0805bd..23f3004700 100644 --- a/src/shared/web-util.c +++ b/src/shared/web-util.c @@ -5,19 +5,6 @@ #include "utf8.h" #include "web-util.h" -bool http_etag_is_valid(const char *etag) { - if (isempty(etag)) - return false; - - if (!endswith(etag, "\"")) - return false; - - if (!STARTSWITH_SET(etag, "\"", "W/\"")) - return false; - - return true; -} - bool http_url_is_valid(const char *url) { const char *p; @@ -62,3 +49,16 @@ bool documentation_url_is_valid(const char *url) { return ascii_is_valid(p); } + +bool http_etag_is_valid(const char *etag) { + if (isempty(etag)) + return false; + + if (!endswith(etag, "\"")) + return false; + + if (!STARTSWITH_SET(etag, "\"", "W/\"")) + return false; + + return true; +} diff --git a/src/shared/web-util.h b/src/shared/web-util.h index 68f868ab0a..8a2f5c537b 100644 --- a/src/shared/web-util.h +++ b/src/shared/web-util.h @@ -5,7 +5,5 @@ bool http_url_is_valid(const char *url) _pure_; bool file_url_is_valid(const char *url) _pure_; - bool documentation_url_is_valid(const char *url) _pure_; - -bool http_etag_is_valid(const char *etag); +bool http_etag_is_valid(const char *etag) _pure_;