MCPcopy Create free account
hub / github.com/Barracuda09/SATPI / getRequestedFile

Method getRequestedFile

src/StringConverter.cpp:172–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172std::string StringConverter::getRequestedFile(const std::string &msg) {
173 const std::string method = StringConverter::getMethod(msg);
174 if (!method.empty()) {
175 const std::string param = StringConverter::getHeaderFieldParameter(msg, method);
176 const std::string::size_type begin = param.find_first_of("/");
177 const std::string::size_type end = param.find_first_of(" ", begin);
178 return param.substr(begin, end - begin);
179 }
180 return "";
181}
182
183std::string StringConverter::getMethod(const std::string &msg) {
184 // request line should be in the first line (method)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected