]>
Commit | Line | Data |
---|---|---|
5dee515e | 1 | /* |
4ac4a490 | 2 | * Copyright (C) 1996-2017 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 | */ |
bbc27441 | 8 | |
b0dd28ba | 9 | #ifndef SQUID_ACLREPLYHEADERSTRATEGY_H |
10 | #define SQUID_ACLREPLYHEADERSTRATEGY_H | |
e1f7507e | 11 | |
127dce76 AR |
12 | #include "acl/Acl.h" |
13 | #include "acl/Data.h" | |
127dce76 | 14 | #include "acl/FilledChecklist.h" |
602d9612 | 15 | #include "acl/Strategy.h" |
7e6b941f | 16 | #include "HttpReply.h" |
5dee515e | 17 | |
789217a2 | 18 | template <Http::HdrType header> |
b0dd28ba | 19 | class ACLReplyHeaderStrategy : public ACLStrategy<char const *> |
62e76326 | 20 | { |
21 | ||
22 | public: | |
4eac3407 | 23 | virtual int match (ACLData<char const *> * &, ACLFilledChecklist *); |
b0dd28ba | 24 | virtual bool requiresReply() const {return true;} |
b0dd28ba | 25 | }; |
26 | ||
789217a2 | 27 | template <Http::HdrType header> |
b0dd28ba | 28 | int |
4eac3407 | 29 | ACLReplyHeaderStrategy<header>::match (ACLData<char const *> * &data, ACLFilledChecklist *checklist) |
b0dd28ba | 30 | { |
a9925b40 | 31 | char const *theHeader = checklist->reply->header.getStr(header); |
b0dd28ba | 32 | |
33 | if (NULL == theHeader) | |
34 | return 0; | |
35 | ||
36 | return data->match(theHeader); | |
37 | } | |
38 | ||
b0dd28ba | 39 | #endif /* SQUID_REPLYHEADERSTRATEGY_H */ |
f53969cc | 40 |