MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / headerValue

Function headerValue

common/transferprotocol.cpp:180–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 std::string headerValue(const std::string& headers, const std::string& key)
181 {
182 std::string needle = key + ":";
183 size_t pos = headers.find(needle);
184 if (pos == std::string::npos) {
185 return "";
186 }
187 pos += needle.size();
188 while (pos < headers.size() && (headers[pos] == ' ' || headers[pos] == '\t')) {
189 pos++;
190 }
191 size_t end = headers.find("\r\n", pos);
192 if (end == std::string::npos) {
193 end = headers.size();
194 }
195 return headers.substr(pos, end - pos);
196 }
197
198 bool constantTimeEquals(const std::string& a, const std::string& b)
199 {

Callers 3

handleUploadFunction · 0.85
handleUploadFunction · 0.85
ckpt_http_header_valueFunction · 0.85

Calls 2

findMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected