add support for preflight requ (cors)
This commit is contained in:
@@ -54,6 +54,10 @@ public:
|
||||
static constexpr const wchar_t * accept_language = L"Accept-Language";
|
||||
static constexpr const wchar_t * authorization = L"Authorization";
|
||||
static constexpr const wchar_t * allow = L"Allow";
|
||||
static constexpr const wchar_t * access_control_allow_methods = L"Access-Control-Allow-Methods";
|
||||
static constexpr const wchar_t * access_control_allow_origin = L"Access-Control-Allow-Origin";
|
||||
static constexpr const wchar_t * access_control_allow_headers = L"Access-Control-Allow-Headers";
|
||||
static constexpr const wchar_t * access_control_max_age = L"Access-Control-Max-Age";
|
||||
|
||||
/*
|
||||
* headers' names lower case
|
||||
|
@@ -1597,6 +1597,19 @@ return false;
|
||||
}
|
||||
|
||||
|
||||
bool Request::AddHeader(const wchar_t * name, long value)
|
||||
{
|
||||
if( !out_headers.has_key(name) )
|
||||
{
|
||||
out_headers.add(name, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Request::AddHeader(const std::wstring & name, const std::wstring & value)
|
||||
{
|
||||
if( !out_headers.has_key(name) )
|
||||
|
@@ -513,6 +513,7 @@ public:
|
||||
|
||||
// RENAMEME to add_header_if_not_exists
|
||||
bool AddHeader(const wchar_t * name, const wchar_t * value);
|
||||
bool AddHeader(const wchar_t * name, long value);
|
||||
bool AddHeader(const std::wstring & name, const std::wstring & value);
|
||||
bool AddHeader(const wchar_t * name, const pt::WTextStream & value);
|
||||
bool AddHeader(const std::wstring & name, const pt::WTextStream & value);
|
||||
|
Reference in New Issue
Block a user