add config options for testing the Origin header in cors requests
- allow_all_cors_origins - whether or not to allow all origins - allowed_cors_origins - a list of allowed origins (used if allow_all_cors_origins is false)
This commit is contained in:
@@ -36,6 +36,8 @@
|
||||
#define headerfile_winix_core_misc
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <ctime>
|
||||
#include <cstdio>
|
||||
@@ -1032,6 +1034,28 @@ void timespec_to_stream_with_unit(timespec & val, pt::Stream & stream);
|
||||
void slice_by(const std::wstring & str, wchar_t c, std::vector<std::wstring> & out);
|
||||
|
||||
|
||||
bool is_in_list(const std::wstring & item, const std::vector<std::wstring> & list);
|
||||
bool is_in_list(const std::wstring & item, const std::list<std::wstring> & list);
|
||||
bool is_in_list(const std::wstring & item, const std::set<std::wstring> & list);
|
||||
|
||||
|
||||
|
||||
template<typename ContainerType>
|
||||
bool is_in_list_generic(const std::wstring & item, const ContainerType & list)
|
||||
{
|
||||
for(const std::wstring & str : list)
|
||||
{
|
||||
if( str == item )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user