]>
Commit | Line | Data |
---|---|---|
5dee515e | 1 | /* |
b8ae064d | 2 | * Copyright (C) 1996-2023 The Squid Software Foundation and contributors |
5dee515e | 3 | * |
bbc27441 AJ |
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. | |
5dee515e | 7 | */ |
8 | ||
9 | #ifndef SQUID_ACLREQUESTHEADERSTRATEGY_H | |
10 | #define SQUID_ACLREQUESTHEADERSTRATEGY_H | |
127dce76 AR |
11 | #include "acl/Acl.h" |
12 | #include "acl/Data.h" | |
602d9612 | 13 | #include "acl/FilledChecklist.h" |
127dce76 | 14 | #include "acl/Strategy.h" |
a2ac85d9 | 15 | #include "HttpRequest.h" |
5dee515e | 16 | |
789217a2 | 17 | template <Http::HdrType header> |
b0dd28ba | 18 | class ACLRequestHeaderStrategy : public ACLStrategy<char const *> |
5dee515e | 19 | { |
62e76326 | 20 | |
21 | public: | |
337b9aa4 AR |
22 | int match (ACLData<char const *> * &, ACLFilledChecklist *) override; |
23 | bool requiresRequest() const override {return true;} | |
5dee515e | 24 | }; |
25 | ||
789217a2 | 26 | template <Http::HdrType header> |
5dee515e | 27 | int |
4eac3407 | 28 | ACLRequestHeaderStrategy<header>::match (ACLData<char const *> * &data, ACLFilledChecklist *checklist) |
5dee515e | 29 | { |
a9925b40 | 30 | char const *theHeader = checklist->request->header.getStr(header); |
62e76326 | 31 | |
aee3523a | 32 | if (nullptr == theHeader) |
62e76326 | 33 | return 0; |
34 | ||
5dee515e | 35 | return data->match(theHeader); |
36 | } | |
37 | ||
5dee515e | 38 | #endif /* SQUID_REQUESTHEADERSTRATEGY_H */ |
f53969cc | 39 |