| 218 | |
| 219 | namespace { |
| 220 | string HttpStatusCodeToString(HttpStatusCode code) { |
| 221 | switch (code) { |
| 222 | case HttpStatusCode::Ok: |
| 223 | return "200 OK"; |
| 224 | case HttpStatusCode::TemporaryRedirect: |
| 225 | return "307 Temporary Redirect"; |
| 226 | case HttpStatusCode::BadRequest: |
| 227 | return "400 Bad Request"; |
| 228 | case HttpStatusCode::AuthenticationRequired: |
| 229 | return "401 Authentication Required"; |
| 230 | case HttpStatusCode::NotFound: |
| 231 | return "404 Not Found"; |
| 232 | case HttpStatusCode::LengthRequired: |
| 233 | return "411 Length Required"; |
| 234 | case HttpStatusCode::RequestEntityTooLarge: |
| 235 | return "413 Request Entity Too Large"; |
| 236 | case HttpStatusCode::InternalServerError: |
| 237 | return "500 Internal Server Error"; |
| 238 | case HttpStatusCode::ServiceUnavailable: |
| 239 | return "503 Service Unavailable"; |
| 240 | } |
| 241 | LOG(FATAL) << "Unexpected HTTP response code"; |
| 242 | return ""; |
| 243 | } |
| 244 | |
| 245 | Status CompressStringToBuffer(const string& content, |
| 246 | vector<uint8_t>& output) { |
no outgoing calls
no test coverage detected