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

Function getVersionFromRequest

src/Server/KeeperHTTPStorageHandler.cpp:48–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48std::optional<int32_t> getVersionFromRequest(const HTTPServerRequest & request)
49{
50 /// we store version argument as a "version" query parameter
51 Poco::URI uri(request.getURI());
52 const auto query_params = uri.getQueryParameters();
53 const auto version_param
54 = std::ranges::find_if(query_params, [](const auto & param) { return param.first == "version"; });
55 if (version_param == query_params.end())
56 return std::nullopt;
57
58 try
59 {
60 return parse<int32_t>(version_param->second);
61 }
62 catch (const std::exception &)
63 {
64 return std::nullopt;
65 }
66}
67
68std::string getRawBytesFromRequest(HTTPServerRequest & request, const KeeperContextPtr & keeper_context)
69{

Callers 2

Calls 3

getURIMethod · 0.80
getQueryParametersMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected