RequestHeaderStrategy.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 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_ACLREQUESTHEADERSTRATEGY_H
10#define SQUID_ACLREQUESTHEADERSTRATEGY_H
11#include "acl/Acl.h"
12#include "acl/Data.h"
13#include "acl/FilledChecklist.h"
14#include "acl/Strategy.h"
15#include "HttpRequest.h"
16
17template <Http::HdrType header>
18class ACLRequestHeaderStrategy : public ACLStrategy<char const *>
19{
20
21public:
23 virtual bool requiresRequest() const {return true;}
24};
25
26template <Http::HdrType header>
27int
29{
30 char const *theHeader = checklist->request->header.getStr(header);
31
32 if (nullptr == theHeader)
33 return 0;
34
35 return data->match(theHeader);
36}
37
38#endif /* SQUID_REQUESTHEADERSTRATEGY_H */
39
virtual bool match(M)=0
HttpRequest * request
virtual bool requiresRequest() const
virtual int match(ACLData< char const * > *&, ACLFilledChecklist *)
A matching algorithm.
Definition: Strategy.h:22
const char * getStr(Http::HdrType id) const
Definition: HttpHeader.cc:1160
HttpHeader header
Definition: Message.h:74

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors