]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/RequestHeaderStrategy.h
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_ACLREQUESTHEADERSTRATEGY_H
10 #define SQUID_ACLREQUESTHEADERSTRATEGY_H
13 #include "acl/FilledChecklist.h"
14 #include "acl/Strategy.h"
15 #include "HttpRequest.h"
17 template <Http::HdrType header
>
18 class ACLRequestHeaderStrategy
: public ACLStrategy
<char const *>
22 int match (ACLData
<char const *> * &, ACLFilledChecklist
*) override
;
23 bool requiresRequest() const override
{return true;}
26 template <Http::HdrType header
>
28 ACLRequestHeaderStrategy
<header
>::match (ACLData
<char const *> * &data
, ACLFilledChecklist
*checklist
)
30 char const *theHeader
= checklist
->request
->header
.getStr(header
);
32 if (nullptr == theHeader
)
35 return data
->match(theHeader
);
38 #endif /* SQUID_REQUESTHEADERSTRATEGY_H */