]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/web-util.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 #include "string-util.h"
9 bool http_etag_is_valid(const char *etag
) {
13 if (!endswith(etag
, "\""))
16 if (!startswith(etag
, "\"") && !startswith(etag
, "W/\""))
22 bool http_url_is_valid(const char *url
) {
28 p
= startswith(url
, "http://");
30 p
= startswith(url
, "https://");
37 return ascii_is_valid(p
);
40 bool documentation_url_is_valid(const char *url
) {
46 if (http_url_is_valid(url
))
49 p
= startswith(url
, "file:/");
51 p
= startswith(url
, "info:");
53 p
= startswith(url
, "man:");
58 return ascii_is_valid(p
);