forked from sony/nmos-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuri_schemes.h
32 lines (27 loc) · 1.03 KB
/
uri_schemes.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
#ifndef CPPREST_URI_SCHEMES_H
#define CPPREST_URI_SCHEMES_H
#include "cpprest/details/basic_types.h"
namespace web
{
// Uniform Resource Identifier (URI) Schemes
// See https://tools.ietf.org/html/rfc7595
// and https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
namespace uri_schemes
{
// Hypertext Transfer Protocol
const utility::string_t http{ U("http") };
// Hypertext Transfer Protocol Secure
const utility::string_t https{ U("https") };
// WebSocket
const utility::string_t ws{ U("ws") };
// WebSocket Secure
const utility::string_t wss{ U("wss") };
}
inline utility::string_t http_scheme(bool secure) { return secure ? uri_schemes::https : uri_schemes::http; }
inline utility::string_t ws_scheme(bool secure) { return secure ? uri_schemes::wss : uri_schemes::ws; }
inline bool is_secure_uri_scheme(const utility::string_t& scheme)
{
return uri_schemes::https == scheme || uri_schemes::wss == scheme;
}
}
#endif