]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/adaptation/Config.cc
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / adaptation / Config.cc
index 536b5a3881c6a9a7877c49955323ef2977e6da86..b90fea802773e4a86b55e26c6713e13c13e6ac3c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -28,24 +28,24 @@ int Adaptation::Config::service_iteration_limit = 16;
 int Adaptation::Config::send_client_ip = false;
 int Adaptation::Config::send_username = false;
 int Adaptation::Config::use_indirect_client = true;
-const char *metasBlacklist[] = {
-    "Methods",
-    "Service",
-    "ISTag",
+static const char *protectedFieldNamesRaw[] = {
+    "Allow",
+    "Date",
     "Encapsulated",
-    "Opt-body-type",
+    "ISTag",
     "Max-Connections",
+    "Methods",
+    "Opt-body-type",
     "Options-TTL",
-    "Date",
-    "Service-ID",
-    "Allow",
     "Preview",
-    "Transfer-Preview",
-    "Transfer-Ignore",
+    "Service",
+    "Service-ID",
     "Transfer-Complete",
-    NULL
+    "Transfer-Ignore",
+    "Transfer-Preview"
 };
-Notes Adaptation::Config::metaHeaders("ICAP header", metasBlacklist);
+static const Notes::Keys protectedFieldNames(std::begin(protectedFieldNamesRaw), std::end(protectedFieldNamesRaw));
+Notes Adaptation::Config::metaHeaders("ICAP header", &protectedFieldNames);
 bool Adaptation::Config::needHistory = false;
 
 Adaptation::ServiceConfig*