| 156 | } |
| 157 | |
| 158 | std::string StringConverter::getProtocol(const std::string &msg) { |
| 159 | // Protocol should be in the first line |
| 160 | std::string::size_type nextline = 0; |
| 161 | const std::string line = StringConverter::getline(msg, nextline, "\r\n"); |
| 162 | if (!line.empty()) { |
| 163 | const std::string::size_type begin = line.find_last_of(" ") + 1; |
| 164 | const std::string::size_type end = line.find_last_of("/"); |
| 165 | if (begin != std::string::npos && end != std::string::npos) { |
| 166 | return line.substr(begin, end - begin); |
| 167 | } |
| 168 | } |
| 169 | return ""; |
| 170 | } |
| 171 | |
| 172 | std::string StringConverter::getRequestedFile(const std::string &msg) { |
| 173 | const std::string method = StringConverter::getMethod(msg); |
nothing calls this directly
no outgoing calls
no test coverage detected