ReplyHeaderStrategy.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9#ifndef SQUID_ACLREPLYHEADERSTRATEGY_H
10#define SQUID_ACLREPLYHEADERSTRATEGY_H
11
12#include "acl/Data.h"
13#include "acl/FilledChecklist.h"
16#include "HttpReply.h"
17
18namespace Acl
19{
20
22template <Http::HdrType header>
23class ReplyHeaderCheck: public ParameterizedNode< ACLData<const char *> >
24{
25public:
26 /* ACL API */
27 int match(ACLChecklist *) override;
28 bool requiresReply() const override {return true;}
29};
30
31} // namespace Acl
32
33template <Http::HdrType header>
34int
36{
37 const auto checklist = Filled(ch);
38
39 char const *theHeader = checklist->reply->header.getStr(header);
40
41 if (nullptr == theHeader)
42 return 0;
43
44 return data->match(theHeader);
45}
46
47#endif /* SQUID_REPLYHEADERSTRATEGY_H */
48
ACLFilledChecklist * Filled(ACLChecklist *checklist)
convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
matches the value of a given reply header (e.g., "rep_mime_type" ACL)
int match(ACLChecklist *) override
Matches the actual data in checklist against this ACL.
bool requiresReply() const override
whether our (i.e. shallow) match() requires checklist to have a reply
Definition: Acl.cc:31

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors