]> git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/RequestMimeType.h
Renamed http_hdr_type to Http::HdrType, fixed some HdrType-int implicit conversions
[thirdparty/squid.git] / src / acl / RequestMimeType.h
1 /*
2 * Copyright (C) 1996-2015 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_ACLREQUESTMIMETYPE_H
10 #define SQUID_ACLREQUESTMIMETYPE_H
11
12 #include "acl/Acl.h"
13 #include "acl/Strategised.h"
14
15 class ACLRequestMIMEType
16 {
17
18 private:
19 static ACL::Prototype RegistryProtoype;
20 static ACLStrategised<char const *> RegistryEntry_;
21 };
22
23 /* partial specialisation */
24
25 #include "acl/Checklist.h"
26 #include "acl/Data.h"
27 #include "acl/RequestHeaderStrategy.h"
28
29 template <>
30 inline int
31 ACLRequestHeaderStrategy<Http::HdrType::CONTENT_TYPE>::match (ACLData<char const *> * &data, ACLFilledChecklist *checklist, ACLFlags &)
32 {
33 char const *theHeader = checklist->request->header.getStr(Http::HdrType::CONTENT_TYPE);
34
35 if (NULL == theHeader)
36 theHeader = "";
37
38 return data->match(theHeader);
39 }
40
41 #endif /* SQUID_ACLREQUESTMIMETYPE_H */
42