]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/web-util.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 Copyright 2010 Lennart Poettering
8 #include "string-util.h"
12 bool http_etag_is_valid(const char *etag
) {
16 if (!endswith(etag
, "\""))
19 if (!startswith(etag
, "\"") && !startswith(etag
, "W/\""))
25 bool http_url_is_valid(const char *url
) {
31 p
= startswith(url
, "http://");
33 p
= startswith(url
, "https://");
40 return ascii_is_valid(p
);
43 bool documentation_url_is_valid(const char *url
) {
49 if (http_url_is_valid(url
))
52 p
= startswith(url
, "file:/");
54 p
= startswith(url
, "info:");
56 p
= startswith(url
, "man:");
61 return ascii_is_valid(p
);