MCPcopy Create free account
hub / github.com/CesiumGS/cesium-native / convertStringToHeaders

Function convertStringToHeaders

CesiumAsync/src/SqliteCache.cpp:124–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124std::optional<HttpHeaders> convertStringToHeaders(
125 const std::string& serializedHeaders,
126 const std::shared_ptr<spdlog::logger>& pLogger) {
127 rapidjson::Document document;
128 document.Parse(serializedHeaders.c_str());
129 if (document.HasParseError()) {
130 SPDLOG_LOGGER_ERROR(
131 pLogger,
132 "Unable to parse http header string from cache.");
133 return std::nullopt;
134 }
135 std::optional<HttpHeaders> headers = std::make_optional<HttpHeaders>();
136 for (rapidjson::Document::ConstMemberIterator it = document.MemberBegin();
137 it != document.MemberEnd();
138 ++it) {
139 headers->insert({it->name.GetString(), it->value.GetString()});
140 }
141 return headers;
142}
143
144} // namespace
145

Callers 1

getEntryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected