-
Notifications
You must be signed in to change notification settings - Fork 4
/
policy.h
39 lines (30 loc) · 1.2 KB
/
policy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _XSCRIPT_POLICY_H_
#define _XSCRIPT_POLICY_H_
#include <string>
#include <vector>
#include <libxml/tree.h>
#include "xscript/component.h"
namespace xscript {
class Context;
class Request;
class TaggedBlock;
class Policy : public Component<Policy> {
public:
Policy();
virtual ~Policy();
virtual const std::string& realIPHeaderName();
virtual std::string getPathByScheme(const Request *request, const std::string &url);
virtual std::string getRootByScheme(const Request *request, const std::string &url);
virtual std::string getKey(const Request* request, const std::string& name);
virtual std::string getOutputEncoding(const Request* request);
virtual void useDefaultSanitizer();
virtual void processCacheLevel(TaggedBlock *block, const std::string &no_cache);
virtual bool allowCaching(const Context *ctx, const TaggedBlock *block);
virtual bool allowCachingInputCookie(const char *name);
virtual bool allowCachingOutputCookie(const char *name);
virtual bool isSkippedProxyHeader(const std::string &header);
virtual bool isErrorDoc(xmlDocPtr doc);
static bool isRemoteScheme(const char *url);
};
} // namespace xscript
#endif // _XSCRIPT_POLICY_H_