| 314 | } |
| 315 | |
| 316 | bool ipIsLocal(const std::string& ip) { |
| 317 | std::vector<std::string> v = tokenize(ip, std::string("."), 0, false); |
| 318 | if (v.size() < 4) { |
| 319 | return true; |
| 320 | } |
| 321 | |
| 322 | if (v[0] == "127" || v[0] == "10") { |
| 323 | return true; |
| 324 | } |
| 325 | |
| 326 | if (v[0] == "192" && v[1] == "168") { |
| 327 | return true; |
| 328 | } |
| 329 | |
| 330 | if (v[0] == "172" && ((atoi(v[1].c_str()) >= 16) && (atoi(v[1].c_str()) <= 31))) { |
| 331 | return true; |
| 332 | } |
| 333 | |
| 334 | return false; |
| 335 | } |
| 336 | |
| 337 | bool BZFSHTTPAuth::verifyToken(const HTTPRequest& request, HTTPReply& reply) { |
| 338 | // build up the groups list |
no test coverage detected