MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / createRedirectHandlerFactory

Function createRedirectHandlerFactory

src/Server/HTTPHandlerFactory.cpp:57–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55};
56
57HTTPRequestHandlerFactoryPtr createRedirectHandlerFactory(
58 const Poco::Util::AbstractConfiguration & config,
59 const std::string & config_prefix,
60 std::unordered_map<String, String> common_headers)
61{
62 std::string url = config.getString(config_prefix + ".handler.location");
63
64 auto headers = parseHTTPResponseHeadersWithCommons(config, config_prefix, common_headers);
65
66 auto factory = std::make_shared<HandlingRuleHTTPHandlerFactory<RedirectRequestHandler>>(
67 [my_url = std::move(url), headers_override = std::move(headers)]()
68 {
69 return std::make_unique<RedirectRequestHandler>(my_url, headers_override);
70 });
71
72 factory->addFiltersFromConfig(config, config_prefix);
73 return factory;
74}
75
76}
77

Callers 1

Calls 3

addFiltersFromConfigMethod · 0.80
getStringMethod · 0.45

Tested by

no test coverage detected