addServerName should do nothing in non-SSL
This commit is contained in:
@@ -104,10 +104,14 @@ public:
|
|||||||
/* Server name */
|
/* Server name */
|
||||||
TemplatedApp &&addServerName(std::string hostname_pattern, SocketContextOptions options = {}) {
|
TemplatedApp &&addServerName(std::string hostname_pattern, SocketContextOptions options = {}) {
|
||||||
|
|
||||||
/* First we create a new router for this domain */
|
/* Do nothing if not even on SSL */
|
||||||
auto *domainRouter = new HttpRouter<typename HttpContextData<SSL>::RouterData>();
|
if constexpr (SSL) {
|
||||||
|
/* First we create a new router for this domain */
|
||||||
|
auto *domainRouter = new HttpRouter<typename HttpContextData<SSL>::RouterData>();
|
||||||
|
|
||||||
|
us_socket_context_add_server_name(SSL, (struct us_socket_context_t *) httpContext, hostname_pattern.c_str(), options, domainRouter);
|
||||||
|
}
|
||||||
|
|
||||||
us_socket_context_add_server_name(SSL, (struct us_socket_context_t *) httpContext, hostname_pattern.c_str(), options, domainRouter);
|
|
||||||
return std::move(*this);
|
return std::move(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user