Use numbers instead of constants for HTTP response code check.
continuous-integration/drone/push Build is failing Details

Poco 1.7 doesn't have HTTPResponse::HTTP_PERMANENT_REDIRECT.
This commit is contained in:
tastytea 2019-08-05 18:49:17 +02:00
parent d74b3cabfa
commit 1d7153008a
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 6 additions and 5 deletions

View File

@ -156,13 +156,14 @@ namespace remwharead
session->sendRequest(request);
istream &rs = session->receiveResponse(response);
// Not using the constants because some are too new for Debian stretch.
switch (response.getStatus())
{
case HTTPResponse::HTTP_MOVED_PERMANENTLY: // 301
case HTTPResponse::HTTP_PERMANENT_REDIRECT: // 308
case HTTPResponse::HTTP_FOUND: // 302
case HTTPResponse::HTTP_SEE_OTHER: // 303
case HTTPResponse::HTTP_TEMPORARY_REDIRECT: // 307
case 301: // HTTPResponse::HTTP_MOVED_PERMANENTLY
case 308: // HTTPResponse::HTTP_PERMANENT_REDIRECT
case 302: // HTTPResponse::HTTP_FOUND
case 303: // HTTPResponse::HTTP_SEE_OTHER
case 307: // HTTPResponse::HTTP_TEMPORARY_REDIRECT
{
return make_request(response.get("Location"));
}