添加项目文件。
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include "Export.h"
|
||||
|
||||
class UNSWSC_DLL_EXPORT CORSConfig
|
||||
{
|
||||
private:
|
||||
int max_age;
|
||||
bool allow_cookie;
|
||||
std::set<std::string> validate_urls;
|
||||
std::set<std::string> validate_hosts;
|
||||
std::set<std::string> validate_headers;
|
||||
std::set<std::string> validate_methods;
|
||||
|
||||
public:
|
||||
CORSConfig();
|
||||
|
||||
public:
|
||||
int GetMaxAge() const;
|
||||
bool AllowCookie() const;
|
||||
std::string GetValidateMethods() const;
|
||||
bool UrlValidate(const std::string& url) const;
|
||||
bool HostValidate(const std::string& host) const;
|
||||
bool IsMethodAllowed(const std::string method) const;
|
||||
std::string GetValidateHeaders(const std::set<std::string>& headers = {}) const;
|
||||
|
||||
public:
|
||||
void SetMaxAge(int max_age);
|
||||
void SetAllowCookie(bool allow);
|
||||
void AddValidateUrls(const std::string& url);
|
||||
void AddValidateHost(const std::string& host);
|
||||
void AddValidateMethods(const std::string& method);
|
||||
void AddValidateHeaders(const std::string& header);
|
||||
};
|
||||
|
||||
extern UNSWSC_DLL_EXPORT CORSConfig GlobalCORSConfig;
|
||||
Reference in New Issue
Block a user