]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/web-util.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 #include "string-util.h"
10 bool http_etag_is_valid(const char *etag
) {
14 if (!endswith(etag
, "\""))
17 if (!STARTSWITH_SET(etag
, "\"", "W/\""))
23 bool http_url_is_valid(const char *url
) {
29 p
= STARTSWITH_SET(url
, "http://", "https://");
36 return ascii_is_valid(p
);
39 bool documentation_url_is_valid(const char *url
) {
45 if (http_url_is_valid(url
))
48 p
= STARTSWITH_SET(url
, "file:/", "info:", "man:");
52 return ascii_is_valid(p
);