| 222 | |
| 223 | |
| 224 | void cHTTPRequest::OnHeaderLine(const AString & a_Key, const AString & a_Value) |
| 225 | { |
| 226 | if ( |
| 227 | (NoCaseCompare(a_Key, "Authorization") == 0) && |
| 228 | (strncmp(a_Value.c_str(), "Basic ", 6) == 0) |
| 229 | ) |
| 230 | { |
| 231 | AString UserPass = Base64Decode(a_Value.substr(6)); |
| 232 | size_t idxCol = UserPass.find(':'); |
| 233 | if (idxCol != AString::npos) |
| 234 | { |
| 235 | m_AuthUsername = UserPass.substr(0, idxCol); |
| 236 | m_AuthPassword = UserPass.substr(idxCol + 1); |
| 237 | m_HasAuth = true; |
| 238 | } |
| 239 | } |
| 240 | if ((a_Key == "Connection") && (NoCaseCompare(a_Value, "keep-alive") == 0)) |
| 241 | { |
| 242 | m_AllowKeepAlive = true; |
| 243 | } |
| 244 | AddHeader(a_Key, a_Value); |
| 245 | } |
| 246 | |
| 247 | |
| 248 |
no test coverage detected